0

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.

Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
Casper Round
  • 343
  • 2
  • 14
  • 2
    `Is there anyway to use method patch inside either POST or PUT` That makes no sense. PATCH is a HTTP verb in the same sense of POST and PUT, so it cannot be 'inside' one of them – Rory McCrossan Jun 05 '17 at 11:24

1 Answers1

1

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.

Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177