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.
#!/bin/bash # access_res=$(curl "http://192.168.1.1:30100/api/v1/ability_sub/external/getToken?appId=d53e9b4083a8577e31dae685305fd032&secret=27766999 0d60d4616a8ae1fd9d6fc114") 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 http://192.168.1.1:30202/app-l59q59yp3po2 7l-store/quality/faultOrderQ?'${access_token} echo $accress_url $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 http://192.168.1.1:30202/app-l59q59yp3po2 7l-store/quality/faultOrderQ?'${access_toke
In this way, you can add scheduled tasks
Similar Posts:
- PHP Curl: How to Sending Post JSON Formate Data
- [Solved] react native TypeError: Network request failed Unable to symbolicate stack trace: The stack is null
- Postman reported an error unsupported media type [How to Solve]
- [Solved] K8s cannot delete the namespace. It is always in the terminating state.
- Visit the latest version of Jenkins API and report error 403 no valid crush was included in the request solution
- failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
- [Solved] ElasticSearch Error: FORBIDDEN/12/index read-only/allow delete (api) ,read_only_allow_delete Set windows
- CSRF verification failed. Request aborted [How to Solve]
- Call JIRA API to create issue prompt xsrf check failed
- When parsing background JSON data with Ajax: unexpected token o in JSON at position 1