Search code examples
curldreamfactory

How to convert below curl command in to php formate?


I want to convert this terminal command into php curl format, or http post can you please help?

curl -i -k -3 -X PATCH "http://localhost:8080/api/v2/db/_table/todo/1" \
  -H "X-DreamFactory-Api-Key: <api key for app in the apps tab>" \
  -H "X-DreamFactory-Session-Token: <session token from login response>" \
  -H "Content-Type: application/json" \
  -d '{ "complete" : true }'

Solution

  • The easiest way is probably to use cURL. See http://codular.com/curl-with-php for some examples.