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