-1

I have an endpoint that takes a list of email address (could be a very long list) and finds users with that email. What HTTP verb is best for this?

I am thinking GET as there is no backend mutation but is GET ideal for sending this kind of data to the server?

3
  • How are you sending the data? A GET method wouldn't have a body, but would accept query parameters. GET makes the most sense to me based on what the request does. Commented Dec 3, 2018 at 5:47
  • That is another problem. How do I send a list with GET in an ideal and scalable way Commented Dec 3, 2018 at 5:48
  • I think that's a matter of opinion from what I've seen. You could specify the query parameter be comma separated. Or send duplicate query parameters, take a look at stackoverflow.com/questions/11621477/… the second answer specifically. Commented Dec 3, 2018 at 5:55

1 Answer 1

2

As you are only searching based on free-text I would suggest using GET, it covers everything you need. Your method is not creating/updating/deleting any data, simply collecting and passing it back. This is exactly the purpose of the GET method.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.