Should I use post requests over get requests?

Viewed 26

So basically I am working on an API that has authenticated routes and in order to access the route, you must pass a token and a userId. The way I currently have this implemented is the token in an Authorization header and the userId in the req body.

However, I find myself sending post requests for methods that are really meant for get requests such as fetching a user's search history but since the route is protected, I need to send the token and userId which forces me to use a post request instead.

This has made it so that all of the typical get requests are post requests. I read that post requests are slower than get requests but since the request body is so small, I don't think performance is really an issue.

But still I just want to make sure: Is it appropriate/acceptable to use post requests instead of get requests?

I know that it obviously works, but is it proper API "architecture"?

Thank you!

0 Answers
Related