locked
Set content type on BackgroundUploader RRS feed

  • Question

  • Hi

    I am trying to upload a multipart form request but the Content-type must be

    multipart/related

    Is there any way I can override the current default?

    I have tried setting it using setRequestHeader but with no luck.

    Thanks

     
    Friday, January 11, 2013 10:13 PM

Answers

  • No, you cannot change the Content-Type of a multi-part upload request for the BackgroundUploader class. If you want to create a custom HTTP request, you can do so using IXMLHttpRequest interface for C++ or XHR for HTML/WinJS or the HttpClient class for C#.

    Thanks,

    Prashant

    Friday, January 11, 2013 11:20 PM
    Moderator

All replies

  • No, you cannot change the Content-Type of a multi-part upload request for the BackgroundUploader class. If you want to create a custom HTTP request, you can do so using IXMLHttpRequest interface for C++ or XHR for HTML/WinJS or the HttpClient class for C#.

    Thanks,

    Prashant

    Friday, January 11, 2013 11:20 PM
    Moderator
  • It appears you can by setting the ContentType in the request header and calling passing the content disposition and boundary to createUploadAsync.
    Friday, January 11, 2013 11:27 PM
  • Yes, the overloaded function lets you set the multipart type as well as the boundary, but what I was saying is that if you change the Content-type header completely, then it does not remain a multi-part request/upload :).

    Thanks,

    Prashant.

    Friday, January 11, 2013 11:48 PM
    Moderator