client_golang/api
beorn7 64b4a9cf9d API client: Enable fallback on status code 501, too
When discussing #801, I remembered #794. While dealing with the
latter, I read the HTTP RFC, stumbling upon the following:

    When a request method is received
    that is unrecognized or not implemented by an origin server, the
    origin server SHOULD respond with the 501 (Not Implemented) status
    code.  When a request method is received that is known by an origin
    server but not allowed for the target resource, the origin server
    SHOULD respond with the 405 (Method Not Allowed) status code.

Concluding from that, it is possible that a server desiring a fallback
to GET will send a status code of 501. It is even preferred if that
server does not offer any resource to be used with the POST method.

Therefore, I think we should fallback to GET on a 501, too.

Signed-off-by: beorn7 <beorn@grafana.com>
2020-09-10 13:14:07 +02:00
..
prometheus/v1 API client: Enable fallback on status code 501, too 2020-09-10 13:14:07 +02:00
client.go Moved warnings into apiclient 2019-12-11 10:04:00 -05:00
client_test.go Refactor ~worked. All tests passing except one 2019-12-10 16:53:38 -05:00