I’m dealing with the communication with a legacy system throught REST services
I’m using JsonClient to Post data with the following code
string rawResp;
try
{
using (HttpWebResponse resp = await base.PostAsync<HttpWebResponse>(targetUrl, requestDto, cancelToken))
{
rawResp = resp.ReadToEnd();
}
}
catch (Exception ex)
{
... // error handling
}
the code breaks at await base.PostAsync(....
the exception I get is type WebServiceException
and the InnerException.Message
is
Type definitions should start with a '{', expecting serialized type 'ErrorResponse', got string starting with: <html><head>.....
I was expecting HttpWebResponse
doesn’t force deserializations but it’s happening
is there a way to avoid the client deserialization at all?
ovverring the Format
and setting text
doesn’t help
thanks