what are the reasons for when using cURL form linux server to access the site return an error. but opening this site in chrome succeeds.
There are many HTTP/HTTPS links that require certain headers in order to work. So this will result in a working response from a web browser but not a working response in a backend web request like curl.
At the most fundamental, cURL lets you talk to a server by specifying the location (in the form of a URL) and the data you want to send. cURL supports several different protocols, including HTTP and HTTPS, and runs on almost every platform.
Curl is commonly considered a non-interactive web browser. That means it's able to pull information from the internet and display it in your terminal or save it to a file.
From Chrome and Edge On the line of the specific resource you are interested in, you right-click with the mouse and you select "Copy as cURL" and it will generate a command line for you in your clipboard. Paste that in a shell to get a curl command line that makes the transfer.
Look browsers headers while sending your request, and add same headers to cURL request. Some servers needs some headers that browsers sends default but not cURL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With