Issue
I have a post request that I am submitting using CURL:
curl -L -X POST https://pubsub.googleapis.com/v1/projects/projectName/subscriptions/subName:pull?key=redactedAPIKey
I need to add a request body to the request that looks like this:
‘{“returnImmediately”: true, “maxMessages”: 1}’
What is the proper syntax for achieving this?
I have tried:
curl -L -X POST https://pubsub.googleapis.com/v1/projects/projectName/subscriptions/subName:pull?key=redactedAPIKey -H 'Content-Type: application/json' -d ‘{“returnImmediately”: true, “maxMessages”: 1}’
Which failed.
Solution
Try this
curl -XPOST -H "Content-type: application/json" -d '{'returnImmediately': true, maxMessages: 1}' 'urlHere'
Answered By - Anthony Answer Checked By - Marilyn (WPSolving Volunteer)