Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST service with 'SearchCriteria' is of type GET #1085

Closed
rklerck opened this issue Mar 10, 2015 · 5 comments
Closed

REST service with 'SearchCriteria' is of type GET #1085

rklerck opened this issue Mar 10, 2015 · 5 comments

Comments

@rklerck
Copy link

rklerck commented Mar 10, 2015

I'm experimenting with the available REST services (for example 'rest/V1/products'), but in 'webapi.xml' it is routed as a GET service. But since a json request needs to be send to the service with the searchcriteria, it should by of type 'PUT', right?

It's for every service as far as I looked. Changed it to PUT and it works..

@anupdugar
Copy link
Contributor

@rklerck Thanks for reporting the issue. As part of #927 all the search related routes were converted to GET. It seems some of the changes were overwritten. We will investigate further and let you know if its a bug.

@rklerck
Copy link
Author

rklerck commented Mar 10, 2015

I'm reading the related bugs, and maybe I'm not seeing the possibility on how to send the searchcriteria with GET..

@anupdugar
Copy link
Contributor

@rklerck We are still working on the documentation for our REST apis but a search sample would be something like:
GET /products?searchcriteria[filter_groups][0][filters][0][field]=sku&searchcriteria[filter_groups][0][filters][0][value]=someSampleSku&searchcriteria[filter_groups][0][filters][0][condition_type]=eq&searchcriteria[current_page]=1&searchcriteria[page_size]=1

@alankent
Copy link

GET vs PUT vs POST is one of those semi religious topics.

This one was quite a good read http://stackoverflow.com/questions/978061/http-get-with-request-body. As you work your way down you start with doing a POST to and end point, with a slightly sheepish "oh well". Then later it says things like some proxies may not work. Then "elastic search encourages it".

GET is semantically more correct as there are no side effects.

@rklerck
Copy link
Author

rklerck commented Mar 11, 2015

Thanks for the explanation. I will close this issue than.

@rklerck rklerck closed this as completed Mar 11, 2015
magento-team pushed a commit that referenced this issue May 9, 2017
[EngCom] Public Pull Requests

 - MAGETWO-68979: Fix breadcrumbs extra space #9514
 - MAGETWO-68977: fix for Class Magento\Framework\Console\CLI not found in case sensitive scenarios #9539
 - MAGETWO-68861: Fix data deletion using the multiple delete command #9446
 - MAGETWO-67722: Add ability to inject exception code in LocalizedException #9363
VitaliyBoyko pushed a commit to VitaliyBoyko/magento2 that referenced this issue Jun 22, 2018
MSI-858: [Configuration-Stocks] Admin user applied Mass action: Delet…
@apriddy-16 apriddy-16 mentioned this issue Feb 9, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants