-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SendGrid v3 and HTML emails - Creates bad Json #256
Comments
The issue is in CSharpHttpClient/Client.cs which for no valid reason does this:
|
Thanks @gliljas! That feedback should speed the resolution of this issue. |
I had the same problem |
same problem!!! |
Hello @gliljas, @cosaques and @georgeemr, I believe this is fixed in v7.0.3. |
It solves the problem, but I strongly disagree with the solution. CSharpHttpClient still replaces single quotes with double quotes, which is has no business doing. If someone wants to use CSharpHttpClient as a generic API client, they will be surprised to find that it modifies the valid JSON. Trust JSON.NET to do the right thing without any special escaping settings. It always produces valid JSON, such as
|
I recall having some issues with the JSON.NET results, that is why I implemented that hack. I believe it had something to do with this: http://stackoverflow.com/a/10679340 but I'm not sure. I know that is not the best answer and I'll leave this ticket open so we further investigate come up with a better solution. If you have any suggestions, please let me know. Thank you very much for your support and for taking the time to suggest improvements! |
I opened this issue: sendgrid/csharp-http-client#7 ...since that's where the problem is. |
@Surfrat could you also provide the raw json that is in the image above? |
Perfect, thanks! |
Good news... I will test my web app tomorrow. |
@thinkingserious Everything is ok for me too. Thanks |
Fixed:
Thanks to all on this thread for your continued patience! |
I used the v2 API with no problems. I am now using the v3 API and I get a BadRequest response after sending. I investigated with Fiddler and I can see that the Json that is created for my email is bad.
See my problem here.
Thanks
Mark.
The text was updated successfully, but these errors were encountered: