Browse Source

finish slides

master
Brett Langdon 12 years ago
parent
commit
30271843fe
12 changed files with 101 additions and 13 deletions
  1. +1
    -1
      slides/01_intro.md
  2. +2
    -2
      slides/02_what_is_curl.md
  3. +0
    -0
      slides/03_quick_examples.md
  4. +2
    -1
      slides/04_helpful_args.md
  5. +3
    -3
      slides/05_dowload_file.md
  6. +3
    -3
      slides/06_head.md
  7. +3
    -3
      slides/07_cookies.md
  8. +19
    -0
      slides/08_redirects.md
  9. +19
    -0
      slides/09_http_post.md
  10. +21
    -0
      slides/10_post_file.md
  11. +16
    -0
      slides/11_ssl.md
  12. +12
    -0
      slides/12_learn_more.md

slides/1_intro.md → slides/01_intro.md View File


slides/2_what_is_curl.md → slides/02_what_is_curl.md View File


slides/3_quick_examples.md → slides/03_quick_examples.md View File


slides/4_helpful_args.md → slides/04_helpful_args.md View File


slides/5_dowload_file.md → slides/05_dowload_file.md View File


slides/6_head.md → slides/06_head.md View File


slides/7_cookies.md → slides/07_cookies.md View File


+ 19
- 0
slides/08_redirects.md View File

@ -0,0 +1,19 @@
# Following Redirects
* `-I` - Response headers only
* `-L` - Follow redirects
```bash
$ curl -I -L http://google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
...
Expires: Sat, 31 May 2014 12:50:05 GMT
Cache-Control: public, max-age=2592000
HTTP/1.1 200 OK
Date: Thu, 01 May 2014 12:50:05 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
...
```

+ 19
- 0
slides/09_http_post.md View File

@ -0,0 +1,19 @@
# HTTP POST Data
* `-X METHOD` - Set HTTP Request Method
* `-d DATA` - Send request form data
```bash
$ curl -X POST -d "name=brett&talk=curl" http://httpbin.org/post
{
"form": {
"name": "brett",
"talk": "curl"
},
"headers": {
"Host": "httpbin.org",
"Content-Type": "application/x-www-form-urlencoded",
...
},
...
}
```

+ 21
- 0
slides/10_post_file.md View File

@ -0,0 +1,21 @@
# HTTP POST File
* `-d @FILE` - Send _FILE_ with the request
* `-X METHOD` - Set HTTP request method
* `-H HEADER` - Add _HEADER_ to request headers
```bash
$ cat data.json
{"name": "brett","talk": "curl"}
$ curl -X POST -d @data.json \
-H "Content-Type: application/json" http://httpbin.org/post
{
"data": "{\"name\": \"brett\",\"talk\": \"curl\"}",
"json": {
"talk": "curl",
"name": "brett"
},
"headers": {
"Content-Type": "application/json",
...
}
```

+ 16
- 0
slides/11_ssl.md View File

@ -0,0 +1,16 @@
# HTTPS
```bash
$ curl https://www.google.com
<!doctype html><html itemscope=""
itemtype="http://schema.org/WebPage"
lang="en"><head>
...
```
#### Allow Insecure Certs
* `-k` - Allow Insecure Certs
```bash
$ curl -k https://insecure-site.gov
```

+ 12
- 0
slides/12_learn_more.md View File

@ -0,0 +1,12 @@
# Learning More
* cURL Website
* http://curl.haxx.se/
* This talk
* http://brettlangdon.github.io/curl-talk
* httpbin (test http request/response)
* http://httpbin.org/
```bash
$ man curl
$ curl --help
```

Loading…
Cancel
Save