4

I'd like to send a multipart/mixed http request ($batch) to an asp.net web api controller, as follows:

--batch_fb0c-6847-2810
Content-Type: multipart/mixed; boundary=changeset_08b4-5b66-0d79

--changeset_08b4-5b66-0d79
Content-Type: application/http
Content-Transfer-Encoding: binary

POST People HTTP/1.1
Content-Id: 1
Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7,                 application/json;q=0.5, */*;q=0.1
DataServiceVersion: 1.0
Content-Type: application/json
MaxDataServiceVersion: 3.0

{"Id":1,"Task":"1","DueDate":"2013-02-    21T11:34:06.247","Completed":false,"University":1,"Degree":1}
--changeset_08b4-5b66-0d79
Content-Type: application/http
Content-Transfer-Encoding: binary

POST People HTTP/1.1
Content-Id: 2
Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7,     application/json;q=0.5, */*;q=0.1
DataServiceVersion: 1.0
Content-Type: application/json
MaxDataServiceVersion: 3.0

{"Id":4,"Task":"2","DueDate":"2013-02-21T11:34:06.247","Completed":false,"University":4,"Degree":4}

--changeset_08b4-5b66-0d79--

--batch_fb0c-6847-2810--

The problem is my request is not routed to proper action in my controller, is there any solution out there to accomplish this issue?!

1 Answer 1

1

The previous answer is outdated. Batch support has been added to the Web API project, complete documentation is here:

https://aspnetwebstack.codeplex.com/wikipage?title=Web+API+Request+Batching

Sign up to request clarification or add additional context in comments.

1 Comment

Hello, Although Batch support has been added, there's a gnarly bug in the .NET framework I believe which doesn't parse multi-part requests that do not end with CRLF (or \r\n) correctly. This happens when using POSTMAN. We always get the following error: Unexpected end of MIME multipart stream. MIME multipart message is not complete. Any thoughts?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.