-
Notifications
You must be signed in to change notification settings - Fork 260
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
Handle that ContentType might be null #141
Conversation
var contentType = String.Join (" ", request.Content.Headers.GetValues ("Content-Type")); | ||
var contentType = string.Empty; | ||
if (request.Content.Headers.ContentType != null) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this bracket up to the previous line
Great PR! I'll make these reverts go away, throw in an extra commit to fix the bracket. No need to close and resubmit! |
Bracket moved, thanks for your fast response. Amazing work Paul! |
Merged by hand - thanks @peterno! |
Unfortunately it does not work when using it with SignalR and 2.4.0. I tried to change back the OkHttp.dll to the one in 2.3.0 but that gave other errors with the Builder. My linkersettings is None and i am using Xamarin.Andriod: 4.20.2.1 and Xamarin 3.9.547.0 in Visual Studio. I have to switch back to 2.3.0 and my own fork of the Android version. Stacktrace is:
|
When using ModernHttpClient with SignalR it crashes on Android because SignalR does not set content type when posting data to the server.
If ContentType is null then string.Empty is used for MediaType.Parse and it thereby returns null and null is valid for RequestBody.Create.
Fixes #136