0

I am creating an API, which is going to list me products page by page with given filter conditions.

To give a brief description, it holds a AWS Lambda behind AWS API.

I am not able to decide whether to use GET or POST.

  • Because querying is considered a GET operation, so this is natural choice. But having a GET operation with JSON body is not very convenient way. So basically, I am left with the choice of putting it in URL.
  • About POST, I wont be able to use API cache in future if required.

Please suggest the right way.

1 Answer 1

1

Use GET.

Many clients do not support the body for GET, use URL params instead of the body. GET can be cached, bookmarked. Also GET is a natural choice as you are not updating any data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.