In some error cases, SendWithUs returns a single string with a text/html header.
One such case is when the data payload is too big (over 120 KB). The response is:
Content-Type: text/html
email_data must not exceed 128 kB. Got 143.04 kB
In these cases, the client assumes a JSON body and attempts to deserialize into a JToken. But that fails with an exception:
[System.Net.Http.UnsupportedMediaTypeException: No MediaTypeFormatter is available to read an object of type 'JToken' from content with media type 'text/html'.]
at System.Net.Http.HttpContentExtensions.ReadAsAsyncT(HttpContent content, Type type, IEnumerable`1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)
In some error cases, SendWithUs returns a single string with a
text/htmlheader.One such case is when the data payload is too big (over 120 KB). The response is:
In these cases, the client assumes a JSON body and attempts to deserialize into a
JToken. But that fails with an exception: