Commit graph

34 commits

Author SHA1 Message Date
Simon Cruanes
f70f25d951 make sure to setup PUT correctly
follow https://curl.se/libcurl/c/CURLOPT_UPLOAD.html and also set
the method to PUT.
2023-02-07 11:07:39 -05:00
Edwin Török
5ba64ee30a ezcurl: allow POST with non-form data
Currently ezcurl always sets CURLOPT_HTTPPOST, but that means it is not able
to send a custom body that is not a form (e.g. JSON is quite a common use-case
these days).

Add a special case: if the POST params is empty, *and* a 'content' is set, then
just set CURLOPT_POST, but not CURLOPT_HTTPPOST.

Example usage:
```
let contents = Ezjsonm.to_string json in
let config = EZ.Config.(verbose true default) in
match EZ.post ~config ~url ~params:[] ~content:(`String contents) () with
```

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
2023-02-02 12:05:46 -05:00
Simon Cruanes
916f72fb39
prepare for 0.2.2 2023-01-25 13:44:38 -05:00
Simon Cruanes
953db1f130 fix test 2023-01-25 13:43:35 -05:00
Simon Cruanes
cfcd23d16a fix: do not reset client if passed as argument
close #7
2023-01-25 13:43:35 -05:00
Simon Cruanes
db9b18fb44
prepare for 0.2.1 2021-10-07 13:20:37 -04:00
Simon Cruanes
c568f9e4e3
fix setting of headers
close #6
2021-10-07 13:09:23 -04:00
Simon Cruanes
1a21521b35
prepare for 0.2 2021-09-29 09:24:02 -04:00
Simon Cruanes
3d12ab0c1d
fix warning 2021-09-29 09:05:28 -04:00
Simon Cruanes
fe35e81fe0 minor changes to improve compatibility 2021-09-29 09:05:05 -04:00
zapashcanon
7b0c8230ae add a default user-agent 2021-09-29 09:05:05 -04:00
Simon Cruanes
78aff9928d chore: add missing bound from opam-repo (thx @kit-ty-kate) 2021-07-30 13:13:01 -04:00
Simon Cruanes
a1e2d7f600 enrich content type so it can be a stream.
- content is now either a string, or a callback function writing into
  a buffer
- also fix potential performance issue in body reading
- add `?content` to post
2021-07-30 12:43:36 -04:00
Simon Cruanes
6795c5b64a style 2021-07-22 11:04:34 -04:00
Simon Cruanes
93471ea0a7 update readme 2021-07-22 10:59:50 -04:00
Simon Cruanes
f9d8eb7220 move to github actions 2021-07-22 10:59:16 -04:00
Simon Cruanes
0733fc8b1e chore: try to appease mdx 2020-03-03 12:13:13 -06:00
Simon Cruanes
99b21c29cc chore: update some build files 2020-03-03 09:37:41 -06:00
Simon Cruanes
cc8adf48e1 doc: point to example 2019-09-17 08:50:43 -05:00
Simon Cruanes
89165cc80d add license file (MIT) 2019-09-16 12:59:46 -05:00
Simon Cruanes
fa37890804 feat: add a way to send content 2019-09-14 12:50:33 -05:00
Simon Cruanes
8ee9668441 fix build 2019-09-14 12:30:53 -05:00
Simon Cruanes
863a6263bb feat: add an example, a simple web crawler that looks for deadlinks 2019-09-14 12:25:34 -05:00
Simon Cruanes
54e7d1740f feat: add more methods, add range parameter 2019-09-14 11:28:28 -05:00
Simon Cruanes
637674f6d0 feat: add some printers 2019-09-14 10:54:53 -05:00
Simon Cruanes
879272f313 chore: fix travis 2019-09-14 10:43:27 -05:00
Simon Cruanes
5e2968a87e doc: update readme 2019-09-14 10:42:03 -05:00
Simon Cruanes
1dcde0d0a8 chore: add travis support 2019-09-14 10:29:53 -05:00
Simon Cruanes
d6c687d16c doc: use mdx to update the readme (and test) 2019-09-14 10:27:06 -05:00
Simon Cruanes
bf31f32a5b feat: add lwt wrapper 2019-09-14 10:00:38 -05:00
Simon Cruanes
80fc740e39 add Config value 2019-09-13 21:42:33 -05:00
Simon Cruanes
ca83aa49ee chore: modify makefile 2019-09-13 21:32:11 -05:00
Simon Cruanes
4fcc1470e4 add basic readme 2019-09-13 18:25:45 -05:00
Simon Cruanes
84f3a147a7 initial commit 2019-09-13 18:22:56 -05:00