You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to send an email without network connection to remote SMTP server, a response contains 200 OK in StatusCode and HttpRequestException in Body. I think it denies basic HTTP principles and such behaviour is completely unclear. I propose to throw a real exception. If impossible, the code from 4xx-5xx range should be used.
Steps to Reproduce
var sg = new SendGridAPIClient("my_api_key");
Mail mail = new Mail(from, subject, to, content);
//disconnect from Internet before executing this line
var response = await sg.client.mail.send.post(requestBody: mail.Get());
//writes "OK"
Console.WriteLine(response.StatusCode);
//writes ".NET HttpRequestException, raw message: An error occurred while sending the request"
Console.WriteLine(response.Body.ReadAsStringAsync().Result);