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

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 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)