madroach
674eac996b
set options after resetting curl handle ( #29 )
...
format / format (push) Has been cancelled
github pages / deploy (push) Has been cancelled
build / Build (push) Has been cancelled
* set options after resetting curl handle
* format
---------
Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
2026-02-11 16:36:56 -05:00
Simon Cruanes
44a2b9f149
add custom method variant for extended HTTP methods
...
format / format (push) Has been cancelled
github pages / deploy (push) Has been cancelled
build / Build (push) Has been cancelled
close #26
2026-02-09 17:26:41 -05:00
Christopher Zimmermann
1c489f0097
reset easy handle before use
...
One thing this does is reset the request method to the default, which
otherwise would be stuck at any request method previously set with
Curl.set_customrequest
2026-02-09 10:00:24 -05:00
Simon Cruanes
0c4e9f30e1
format
format / format (push) Has been cancelled
github pages / deploy (push) Has been cancelled
build / Build (push) Has been cancelled
2026-02-08 07:53:52 -05:00
Simon Cruanes
aec132d37c
Refactor: group PUT and PATCH together with conditional upload
...
Both methods need identical handling (customrequest + upload flag),
so combine them using pattern matching to reduce duplication.
Only set the upload flag when content is provided, matching the
behavior of POST and preventing curl from trying to read when
there's no content to upload.
2026-02-08 12:48:39 +00:00
Christopher Zimmermann
6662364103
PATCH does upload
2026-02-08 02:38:08 -05:00
Simon Cruanes
4f61478bad
prepare for 0.3
format / format (push) Has been cancelled
github pages / deploy (push) Has been cancelled
build / Build (push) Has been cancelled
2026-01-22 21:34:18 -05:00
Simon Cruanes
69b73e0f69
reformat with 0.27
2026-01-20 20:50:01 -05:00
Christopher Zimmermann
177bd1e572
Provide seek function when uploading from string
...
build / Build (push) Waiting to run
This prevents
CURLE_SEND_FAIL_REWIND (65)
When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed.
on redirections
2026-01-19 22:27:21 -05:00
Simon Cruanes
4b7d9ec769
make CURLOPT_NOSIGNAL=false the default; simplify
build / Build (push) Has been cancelled
2025-01-29 21:55:16 -05:00
Stéphane Lavergne
ebf1e1fc12
Expose underlying no signal in a global setting
2025-01-29 21:46:19 -05:00
Simon Cruanes
49b265ce56
implement http_stream
2024-10-02 12:46:43 -04:00
Simon Cruanes
fbd71baa19
wip: stream response…
2024-10-02 11:43:49 -04:00
Simon Cruanes
e97003644a
refactor: rename files
2024-10-01 12:17:53 -04:00
Simon Cruanes
71a37788ac
feat: add Ezcurl.Cookies module, get/set/transfer them
2024-10-01 12:01:36 -04:00
Simon Cruanes
a8ad44d39e
feat ezcurl: wrap Curl.t in record; add cookie support
2024-10-01 10:59:55 -04:00
Simon Cruanes
d259d85eb7
depend on thread
2023-11-25 00:10:54 -05:00
Simon Cruanes
d41eb2ceb4
fix: global initialization logic is now hidden behind a mutex
2023-11-25 00:10:54 -05:00
Simon Cruanes
be03f25cc0
ocamlformat
2023-06-09 21:06:20 -04:00
Simon Cruanes
73899acdf2
more doc
2023-06-09 21:04:03 -04:00
Simon Cruanes
5bb480235a
remove spurious eprintf
2023-03-09 11:10:50 -05:00
Simon Cruanes
9e7d9be5c3
fix: workaround servers which do not understand Expect header
2023-02-28 11:07:20 -05:00
Simon Cruanes
91cfbc94ad
fix: correctly set size of payload for POST
...
close #12
2023-02-28 11:06:39 -05:00
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
cfcd23d16a
fix: do not reset client if passed as argument
...
close #7
2023-01-25 13:43:35 -05:00
Simon Cruanes
c568f9e4e3
fix setting of headers
...
close #6
2021-10-07 13:09:23 -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
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
fa37890804
feat: add a way to send content
2019-09-14 12:50:33 -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
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
84f3a147a7
initial commit
2019-09-13 18:22:56 -05:00