@@ -37,18 +37,6 @@ POST request
37
37
puts res.body
38
38
```
39
39
40
- PATCH request
41
- ```
42
- res = Curl.patch("https://your-server.com/endpoint", {post: "this"}.to_json) {|http|
43
- http.headers["Content-Type"] = "application/json"
44
- }
45
- puts res.code
46
- puts res.head
47
- puts res.body
48
- ```
49
-
50
-
51
-
52
40
## You will need
53
41
54
42
* 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...)
@@ -64,14 +52,21 @@ tested and reported to work across a variety of platforms / rubies)
64
52
65
53
| Gem Version | Release Date | libcurl versions |
66
54
| ----------- | ----------- | ---------------- |
67
- | 1.0.0 | Jan 2022 | 7.58 - 7.81 |
55
+ | 1.0.5 | Jan 2023 | 7.58 - 7.87 |
56
+ | 1.0.4 | Jan 2023 | 7.58 - 7.87 |
57
+ | 1.0.3* | Dec 2022 | 7.58 - 7.87 |
58
+ | 1.0.2* | Dec 2022 | 7.58 - 7.87 |
59
+ | 1.0.1 | Apr 2022 | 7.58 - 7.87 |
60
+ | 1.0.0 | Jan 2022 | 7.58 - 7.87 |
68
61
| 0.9.8 | Jan 2019 | 7.58 - 7.81 |
69
62
| 0.9.7 | Nov 2018 | 7.56 - 7.60 |
70
63
| 0.9.6 | May 2018 | 7.51 - 7.59 |
71
64
| 0.9.5 | May 2018 | 7.51 - 7.59 |
72
65
| 0.9.4 | Aug 2017 | 7.41 - 7.58 |
73
66
| 0.9.3 | Apr 2016 | 7.26 - 7.58 |
74
67
68
+ ``` *avoid using these version are known to have issues with segmentation faults ```
69
+
75
70
## Installation...
76
71
77
72
... will usually be as simple as:
@@ -137,36 +132,36 @@ require 'curb'
137
132
138
133
``` ruby
139
134
http = Curl .get(" http://www.google.com/" )
140
- puts http.body_str
135
+ puts http.body
141
136
142
137
http = Curl .post(" http://www.google.com/" , {:foo => " bar" })
143
- puts http.body_str
138
+ puts http.body
144
139
145
140
http = Curl .get(" http://www.google.com/" ) do |http |
146
141
http.headers[' Cookie' ] = ' foo=1;bar=2'
147
142
end
148
- puts http.body_str
143
+ puts http.body
149
144
```
150
145
151
146
### Simple fetch via HTTP:
152
147
153
148
``` ruby
154
149
c = Curl ::Easy .perform(" http://www.google.co.uk" )
155
- puts c.body_str
150
+ puts c.body
156
151
```
157
152
158
153
Same thing, more manual:
159
154
160
155
``` ruby
161
156
c = Curl ::Easy .new (" http://www.google.co.uk" )
162
157
c.perform
163
- puts c.body_str
158
+ puts c.body
164
159
```
165
160
166
161
### Additional config:
167
162
168
163
``` ruby
169
- Curl ::Easy .perform(" http://www.google.co.uk" ) do |curl |
164
+ http = Curl ::Easy .perform(" http://www.google.co.uk" ) do |curl |
170
165
curl.headers[" User-Agent" ] = " myapp-0.0"
171
166
curl.verbose = true
172
167
end
0 commit comments