www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: hsteoh quickfur.ath.cx



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: -------
Aug 27 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10911


Sean Kelly <sean invisibleduck.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |sean invisibleduck.org



---
This one has caused me a lot of trouble as well.  I'll sort out a pull request.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 21 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10911


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



I've already done a pull request, but it's being held up because we're not sure
what's the best API for this. See:

https://github.com/D-Programming-Language/phobos/pull/1527

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