[Issue 10911] New: std.net.curl.HTTP: should allow user code to indicate content type of POST data

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 27 11:06:37 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10911

           Summary: std.net.curl.HTTP: should allow user code to indicate
                    content type of POST data
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: hsteoh at quickfur.ath.cx


--- Comment #0 from hsteoh at quickfur.ath.cx 2013-08-27 11:06:36 PDT ---
Currently, std.net.curl.HTTP.postData hardcodes the content type to
application/octet-stream for ubyte[] and text/plain for
[unqual,const,immutable](char)[]. The method that lets you specify content
type, _postData, is a private function.

The workaround is unreasonably complicated: since headers are a singly-linked
list, you can't just use addHeader to replace the default Content-Type header;
you have to iterate over them and add them back, substituting Content-Type with
the desired value. Either that, or use the low-level Curl object directly,
which defeats the purpose of having a high-level API.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list