Melad Basilius
Melad Basilius

Reputation: 4306

Rest , send parameter with Get as query string or just use Post to get information

i need to expose Rest API which retrieve information about Brand based on brandId, so i need to send brandId parameter. from Rest Architecture and Design perspective, should i use Post (with the parameter in the body), or use Get and send the parameter as query string or header

Upvotes: 0

Views: 50

Answers (2)

Melad Basilius
Melad Basilius

Reputation: 4306

i used GET, and sent the parameter brandId as path variable

Upvotes: 0

Araneo
Araneo

Reputation: 497

You should use GET. POST is used to put or update some new information into service/database.

Try to read this: What is the difference between POST and GET?

And this: When should I use GET or POST method? What's the difference between them?

Upvotes: 1

Related Questions