Skip to content

Commit

Permalink
updates to readme with some notes about version history and avoid 1.0…
Browse files Browse the repository at this point in the history
….2 and 1.0.3
  • Loading branch information
taf2 committed Jan 4, 2023
1 parent f495d7c commit 13144ec
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ POST request
puts res.body
```

PATCH request
```
res = Curl.patch("https://your-server.com/endpoint", {post: "this"}.to_json) {|http|
http.headers["Content-Type"] = "application/json"
}
puts res.code
puts res.head
puts res.body
```



## You will need

* A working Ruby installation (`2.0.0+` will work but `2.1+` preferred) (it's possible it still works with 1.8.7 but you'd have to tell me if not...)
Expand All @@ -64,14 +52,21 @@ tested and reported to work across a variety of platforms / rubies)

| Gem Version | Release Date | libcurl versions |
| ----------- | ----------- | ---------------- |
| 1.0.0 | Jan 2022 | 7.58 - 7.81 |
| 1.0.5 | Jan 2023 | 7.58 - 7.87 |
| 1.0.4 | Jan 2023 | 7.58 - 7.87 |
| 1.0.3* | Dec 2022 | 7.58 - 7.87 |
| 1.0.2* | Dec 2022 | 7.58 - 7.87 |
| 1.0.1 | Apr 2022 | 7.58 - 7.87 |
| 1.0.0 | Jan 2022 | 7.58 - 7.87 |
| 0.9.8 | Jan 2019 | 7.58 - 7.81 |
| 0.9.7 | Nov 2018 | 7.56 - 7.60 |
| 0.9.6 | May 2018 | 7.51 - 7.59 |
| 0.9.5 | May 2018 | 7.51 - 7.59 |
| 0.9.4 | Aug 2017 | 7.41 - 7.58 |
| 0.9.3 | Apr 2016 | 7.26 - 7.58 |

```*avoid using these version are known to have issues with segmentation faults```

## Installation...

... will usually be as simple as:
Expand Down Expand Up @@ -137,36 +132,36 @@ require 'curb'

```ruby
http = Curl.get("http://www.google.com/")
puts http.body_str
puts http.body

http = Curl.post("http://www.google.com/", {:foo => "bar"})
puts http.body_str
puts http.body

http = Curl.get("http://www.google.com/") do |http|
http.headers['Cookie'] = 'foo=1;bar=2'
end
puts http.body_str
puts http.body
```

### Simple fetch via HTTP:

```ruby
c = Curl::Easy.perform("http://www.google.co.uk")
puts c.body_str
puts c.body
```

Same thing, more manual:

```ruby
c = Curl::Easy.new("http://www.google.co.uk")
c.perform
puts c.body_str
puts c.body
```

### Additional config:

```ruby
Curl::Easy.perform("http://www.google.co.uk") do |curl|
http = Curl::Easy.perform("http://www.google.co.uk") do |curl|
curl.headers["User-Agent"] = "myapp-0.0"
curl.verbose = true
end
Expand Down

0 comments on commit 13144ec

Please sign in to comment.