0

I'm working on a project with .net-core backend and react/react-native for frontend/mobile. On frontend we use axios for api client. The problem we've got was with HTTP GET method. We wanted to send GET with data in body instead of URL params as it was easier to parse it in backend, but for some reason axios was having problem with dealing with it this way. Now our current solution is to use PATCH instead of GET and want to ask if it is a good/acceptable practice - and if not, what would be the best workaround for this problem?

Pepsko
  • 63
  • 6
  • 1
    The best workaround is to fix your backend. But hey, maybe you'll find an internet stranger that approves your abuse of PATCH semantics to perform what is essentially a GET operation, and then you're off the hook? For reference, see also [here](https://stackoverflow.com/questions/978061/http-get-with-request-body). – Robby Cornelissen May 28 '21 at 08:56
  • FWIW, why PATCH? In general, the fallback if you can't use GET would be POST... – Julian Reschke May 28 '21 at 10:10
  • Just to clear things up - I was one to criticize this approach, but lacked good enough arguments to convince rest of the team to change it. PATCH in this case was used only because this method has not been implemented, so it was free to use. – Pepsko May 28 '21 at 13:21
  • "free to use" doesn't compute - PATCH has a very specifc purpose – Julian Reschke May 28 '21 at 16:33

0 Answers0