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
I think this issue can be viewed as a sibling to #96 and #107.
I noticed that field normalization and JSON encoding is done after calling bodyBuilder. This is contrary to the documentation which states "...or encode the body in some format other than JSON." I'm sure JSON will be used in 99% of the time which is why this hasn't been reported yet, but it seems this should be corrected or the documentation should be changed if it's not a worthwhile feature.
I actually noticed this when investigating why the Content-Type header is set to html instead of application/json using the default body builder. (I know it can be overridden in various ways, but if the link changes the body encoding I feel it should also change the header.) This is the actual issue I wanted to point out, and one that I will address in a PR, but I think when that is done it might be good to resolve the above in full.
If I have time I might also look at inspecting the Content-Type of the response before JSON decoding, and maybe if the response body is empty one could just return an empty object which might solve #107. I'll investigate and see whether that works.
The text was updated successfully, but these errors were encountered:
I think this issue can be viewed as a sibling to #96 and #107.
I noticed that field normalization and JSON encoding is done after calling
bodyBuilder
. This is contrary to the documentation which states "...or encode the body in some format other than JSON." I'm sure JSON will be used in 99% of the time which is why this hasn't been reported yet, but it seems this should be corrected or the documentation should be changed if it's not a worthwhile feature.I actually noticed this when investigating why the
Content-Type
header is set tohtml
instead ofapplication/json
using the default body builder. (I know it can be overridden in various ways, but if the link changes the body encoding I feel it should also change the header.) This is the actual issue I wanted to point out, and one that I will address in a PR, but I think when that is done it might be good to resolve the above in full.If I have time I might also look at inspecting the
Content-Type
of the response before JSON decoding, and maybe if the response body is empty one could just return an empty object which might solve #107. I'll investigate and see whether that works.The text was updated successfully, but these errors were encountered: