Uncategorized

CURL post api json

+Create: curl -H “Content-Type: application/json” -X POST -d ‘{“name”:”xyz”,”description”:”xyz”,”price”:”3232″,”category_id”:”1″}’ http://localhost/restApi/api/product/create.php

 

+ Update: curl -H “Content-Type: application/json” -X POST -d ‘{“id”:”69″,”name”:”xxx”,”description”:”lol”,”price”:”121212″,”category_id”:”1″}’ http://localhost/restApi/api/product/update.php

+ DELETE: curl -H “Content-Type: application/json” -X POST -d ‘{“id”:”69″}’ http://localhost/restApi/api/product/delete.php

+ SEARCH with get TYPE: curl -H “Accept: application/json” -X GET ‘http://localhost/restApi/api/product/search.php?s=zzz’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s