curl
cURL – Structuring request to validate server sent events
SSE is a text-based protocol, and curl is a great way to troubleshoot exactly what your connection is sending. The command is this simple: curl -N http://127.0.0.1/path/to/clock.php (The -N stops any buffering, so data is shown as it is received.) And it outputs this: data:2015-07-07 06:19:27 data:2015-07-07 06:19:28 data:2015-07-07 06:19:29 data:2015-07-07 06:19:30 data:2015-07-07 06:19:31 data:2015-07-07 … Read more
Why doesn’t cURL work with Windows Authentication on IIS7?
If you are using Windows Authentication, you need to use NTLM: curl –ntlm –user username:password http://example.com
curl: (48) An unknown option was passed in to libcurl
Just had this exact issue with Alpine Linux. The fix was to install curl-dev in addition to curl.
How to use ssh authentication with github API?
If you are using ssh, then you would never logon as ‘yrstruly‘. You would always connect as ‘git’. Your public key would be enough for GitHub to recognize you as ‘yrstruly‘. And since you are using an https address, and not an ssh one, that –pubkey option is likely to be ignored. A valid ssh … Read more
How does “curl –retry-max-time ” work?
curl –connect-timeout 5 \ –max-time 10 \ –retry 5 \ –retry-delay 0 \ –retry-max-time 60 \ ‘http://www.site.com/download/file.txt’ |<—0—->| {<—1—->| |<—2—->| |<—3—->| |<—4—->| } |<—5—->| |….== | {…== | |….== | |…..| |..=== = | } { } NOTATION ===== downloading… (file size is 5) ….. –connect-timeout 5 |<->| –max-time 10 <-5-> –retry 5 >| |< … Read more
How to skip already existing files when downloading with curl?
You can use curl option -C -. This option is used to resume a broken download, but will skip the download if the file is already complete. Note that the argument to -C is a single dash. A disadvantage might be that curl still briefly contacts the remote server to ask for the file size.
How to use curl to access the github graphql API
You just need to escape the double quotes that are inside the JSON as the query $ curl -i -H ‘Content-Type: application/json’ -H “Authorization: bearer myGithubAccessToken” -X POST -d ‘{“query”: “query {repository(owner: \”wso2\”, name: \”product-is\”) {description}}”}’ https://api.github.com/graphql
Doing https requests through a SOCKS5 proxy (tor) with curl
I had a similar problem, and using the option –socks5-hostname instead of –socks5 to specify the proxy for curl solved the issue.