Casper Round
Casper Round

Reputation: 343

HTTP PATCH via POST?

Is there any way to use method PATCH inside either POST or PUT?

I'm using a smart mirror repo on my Raspberry Pi, and the only methods it has for custom commands are GET/POST/PUT. And the only method the GPIO-Server has is PATCH I've tried put but it just returns a 405 Method Not Allowed.

Upvotes: 0

Views: 638

Answers (1)

Michał Perłakowski
Michał Perłakowski

Reputation: 92521

No, it's not possible. HTTP method can be either POST or PATCH, but you can't use one method via another. The only solution I can think of is using a proxy, which would change POST requests to PATCH. For example, you would send a POST request to the proxy server, and the proxy server would send a PATCH request with the same data to the destination server.

Upvotes: 1

Related Questions