Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with proxy servers that block specific HTTP request methods?

Tags:

rest

http

proxy

api

I'm designing a REST web API, but noticed something weird lately.

Apparently some proxy servers are blocking specific HTTP request methods. In my case the PUT and PATCH methods which are crucial to modify resources. This partially breaks the functionality of the API I'm designing...

Is there a good way to bypass this problem without breaking the RESTful architecture constraints? In my opinion there isn't, because fully using the HTTP verbs is advocated when designing a REST web API over HTTP...

like image 242
Braek Avatar asked Oct 27 '14 15:10

Braek


1 Answers

You have a few options:

  • Ignore it. People who willingly break the(ir) web (experience) using a malconfigured proxy server will have to deal with the consequences themselves.
  • Ask the proxy administrators to whitelist your host or the methods it accepts.
  • Rewrite your API, "breaking" REST principles.
  • Use HTTPS, so the proxy will only see the connect method.
like image 128
CodeCaster Avatar answered Oct 24 '22 09:10

CodeCaster