How to Solve Curl pass large JSON files Error

Solutions to errors in curl passing large JSON files

Next, the shell first obtains the token, and then sends the JSON file to the server with the token,   After hours of normal JSON files, the following shell can run normally.

access_res=$(curl "

access_token=$(echo $access_res |cut -d":" -f6 |cut -d"}" -f1|sed s/\"//g)

accress_url='curl -i -X POST -H "Content-Type:application/json" -d @/opt/accesstoken/test.json

echo $accress_url

When using curl post data, if the post data is greater than 1024 bytes, curl will not directly initiate the post request. But in two steps.

1. Send a request. The header contains an expect: 100 continue to ask whether the server is willing to accept data

2. After receiving the 100 continue response returned by the server, post the data to the server.

By default, the server is enabled to receive JSON. In this case, the query before sending is removed and – H “expect:” is added, as follows:

accress_url='curl -i -X POST -H "Expect:" -H "Content-Type:application/json" -d @/opt/accesstoken/test.json 7l-store/quality/faultOrderQ?'${access_toke

In this way, you can add scheduled tasks

Similar Posts: