LMSouq
php-dev AI Answered

Curl with multiline of JSON

RY
Ryan
1 month ago
3 views
Problem Description
Consider the curl command below, is it possible to allow newline in JSON (without the minify) and execute directly in bash (Mac/Ubuntu) curl -0 -v -X POST http://www.example.com/api/users \ -H "Expect:" \ -H 'Content-Type: text/json; charset=utf-8' \ -d \ ' { "field1": "test", "field2": { "foo": "bar" } }' When I run the command above, seems error occurred at the `second {` How to fix the above command? **Updated**: actually I was able to run the command without issue previously, not sure why problem happen recently.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base