I had same problem the reason for error was corrected by
Removing backslash \
Replacing --data-raw
to --data
Keeping header and other keys till starting of json in single line
instead of following
curl --location 'https://reqres.in/api/users' \
--header 'Content-Type: application/json' \
--data-raw
to
curl --location 'https://reqres.in/api/users' --header 'Content-Type: application/json' --data '{
"json":"body"
}'
I took following from postman throws error as following
curl: option --data-raw: is unknown
curl: try 'curl --help' or 'curl --manual' for more information'
curl --location 'https://reqres.in/api/users' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "morpheus",
"job": "leader",
"code": {
"page": 1,
"per_page": 6,
"total": 12,
"total_pages": 2,
"data": [
{
"id": 1,
"email": "[email protected]",
"first_name": "George",
"last_name": "Bluth",
"avatar": "https://reqres.in/img/faces/1-image.jpg"
}
],
"support": {
"url": "https://reqres.in/#support-heading",
"text": "To keep ReqRes free, contributions towards server costs are appreciated!"
}
}
}'
same data is corrected now and is working fine
curl --location 'https://reqres.in/api/users' --header 'Content-Type: application/json' --data '{
"name": "morpheus",
"job": "leader",
"code": {
"page": 1,
"per_page": 6,
"total": 12,
"total_pages": 2,
"data": [
{
"id": 1,
"email": "[email protected]",
"first_name": "George",
"last_name": "Bluth",
"avatar": "https://reqres.in/img/faces/1-image.jpg"
}
],
"support": {
"url": "https://reqres.in/#support-heading",
"text": "To keep ReqRes free, contributions towards server costs are appreciated!"
}
}
}'
,
after the"type": "divider"
object – Breadstuff,
after"type"
section didnt resolve the issue. But replacing--data-raw
with just--data
worked. – Invincible