I. badrequest error returned for the request. Possible causes: 1. the url address is incorrect. manually enter a url in the address bar to check whether the request is normal. note: If the url contains a line break, the system may return a. 2.https request. You need to set the corresponding parameter # BelowtwooptionwillenabletheHTTPSoption. curl_setopt ($ c
I. 400 bad request error returned for the request. Possible causes: 1. the url address is incorrect. manually enter a url in the address bar to check whether the request is normal. note: If the url contains a line break, 400 may be returned. 2. for https requests, you must set the corresponding parameter # Below two option will enable the HTTPS option. curl_setopt ($ c
1. The error "400 bad request" is returned for the request. Possible causes:
1. the url address is incorrect.
Manually enter a url in the address bar to check whether the request is normal.
Note: If the url contains a line break, 400 may be returned.
2. parameters need to be set for https requests
# Below two option will enable the HTTPS option.
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, FALSE );
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, FALSE );
3. url_encode transcoding is required for the string passed in the url.
2. url redirection settings:
Curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
Iii. submit data through POST
Curl_setopt ($ curl, CURLOPT_POST, 1); // send a regular Post request
Curl_setopt ($ curl, CURLOPT_POSTFIELDS, $ data); // data packet submitted by Post
Curl_setopt ($ curl, CURLOPT_TIMEOUT, 30); // sets the timeout limit to prevent endless loops.