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
Note that HTTP::Client#exec seems to be generating an HTTP request without the Host header. Adding the missing header will trigger expected 200 response.
The reason I ran into this problem was because I was trying to send the same Request object to multiple Hosts. I expect I should be able to reuse the same request object cross multiple client / hosts. Is this an acceptable usage pattern of the HTTP::Client API?
The text was updated successfully, but these errors were encountered:
newtonapple
changed the title
HTTP::Client#exec causing some "400 Bad Request" response when using it HTTP::Request object.
HTTP::Client#exec causing some "400 Bad Request" response when using it with HTTP::Request object.
Aug 4, 2018
The following code triggers a 400 response from example.com:
Note that
HTTP::Client#exec
seems to be generating an HTTP request without theHost
header. Adding the missing header will trigger expected 200 response.Class method is working as expected:
I also noticed that this didn't seem to be a problem on google.com
The reason I ran into this problem was because I was trying to send the same
Request
object to multiple Hosts. I expect I should be able to reuse the same request object cross multiple client / hosts. Is this an acceptable usage pattern of the HTTP::Client API?The text was updated successfully, but these errors were encountered: