The documentation for Request.Method says: "For client requests an empty string means GET".
But in transport.go, the bare Request.Method gets used, without defaulting to "GET" if the Method is "". This means that if RoundTrip receives an http.Request which has a zero-value .Method, it can't properly look up any GET responders for that request.
The error message from http is a bit misleading:
Get https://my.example.com/endpoint?my_var=my_value: no responder found, makes it look like httpmock doesn't support matching URLs with parameters. Thankfully, after reading the source, I found that it does. (yay!) :)
The documentation for Request.Method says: "For client requests an empty string means GET".
But in transport.go, the bare Request.Method gets used, without defaulting to "GET" if the Method is "". This means that if RoundTrip receives an
http.Request
which has a zero-value.Method
, it can't properly look up any GET responders for that request.The error message from
http
is a bit misleading:Get https://my.example.com/endpoint?my_var=my_value: no responder found
, makes it look like httpmock doesn't support matching URLs with parameters. Thankfully, after reading the source, I found that it does. (yay!) :)