Bug 14877 – std.net.curl needs PATCH http method

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-06T10:23:00Z
Last change time
2015-10-04T18:21:09Z
Keywords
pull
Assigned to
nobody
Creator
trikko

Comments

Comment #0 by trikko — 2015-08-06T10:23:43Z
std.net.curl support GET, PUT, POST, etc.. but PATCH method is missed and there's no way to define a custom method request. (custom requests are allowed with libcurl)
Comment #1 by code — 2015-08-06T23:13:13Z
Would be as simple as adding an enum member to http://dlang.org/phobos/std_net_curl.html#.HTTP.Method and setting the customrequest option. http://stackoverflow.com/questions/14451401/how-do-i-make-a-patch-request-in-php-using-curl Mind to put up a PR?
Comment #2 by trikko — 2015-08-07T07:46:11Z
I'm not sure that's enough. If you search for "method.put" inside source, you see there's a lot of conditions. I think patch is similar to put, but I'm not sure which check are needed to make it work fine.
Comment #3 by code — 2015-08-07T13:00:21Z
Comment #4 by github-bugzilla — 2015-08-23T16:16:45Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/ceb29a91c0c4afd3b502ab3c0e163b1fd27b4d39 fix Issue 14877 - std.net.curl needs PATCH http method - use infilesize for anything but post requests though apparently curl can use both for non-POST methods https://github.com/D-Programming-Language/phobos/commit/6273768859c8c8964adf98f2dd40f0baf6c783b6 Merge pull request #3533 from MartinNowak/fix14877 fix Issue 14877 - std.net.curl needs PATCH http method
Comment #5 by andrea.9940 — 2015-09-09T08:44:06Z
The current version in phobos of std.net.curl.patch does not upload any data in the http request. Small testcase: http://pastebin.com/UujEqh4K Expected: the data field in the response should not be empty --------------------------------- Workaround: change the switch case in std.net.curl.HTTP.perform: [...] case Method.patch: p.curl.set(CurlOption.customrequest, "PATCH"); p.curl.set(CurlOption.upload, 1L); // add this line opt = CurlOption.customrequest; break; [...] Note: probably this workaround does not leave a clean state.
Comment #6 by github-bugzilla — 2015-10-04T18:20:28Z