Unexpected end of multiparty form - json - postsave
We are attempting to use the back office api postsave json.
Whenever we attempt it we get a 500 error.
We have tried changing the mime type, charset adding \r\n to the params but with no luck.
The json blob that is used in the grid in 7 has json in a content field and this gets pretty messy we have noticed. We have also noticed that the getbyid method has some malformed json too.
Are there any known defects or others with the same issue?
We created a cap file for Wireshark and managed to get a better error, see below.
"unexpected end of mime multipart stream )]}', \n"
Here is the extra information I found from Wireshark
{"Message":"An error has occurred.","ExceptionMessage":"Unexpected end of MIME multipart stream. MIME multipart message is not complete.","ExceptionType":"System.IO.IOException","StackTrace":" at System.Net.Http.Formatting.Parsers.MimeMultipartBodyPartParser.
Unexpected end of multiparty form - json - postsave
We are attempting to use the back office api postsave json.
Whenever we attempt it we get a 500 error. We have tried changing the mime type, charset adding \r\n to the params but with no luck.
The json blob that is used in the grid in 7 has json in a content field and this gets pretty messy we have noticed. We have also noticed that the getbyid method has some malformed json too.
Are there any known defects or others with the same issue?
We created a cap file for Wireshark and managed to get a better error, see below.
"unexpected end of mime multipart stream )]}', \n"
The characters
)]}',
at the beginning of a response is a feature of Umbraco/AngularJS to avoid JSON hijacking:https://docs.angularjs.org/api/ng/service/$http#json-vulnerability-protection
Can you post the code that you are using?
(Side note: I'm having issues with the above link, it seems because of the dollar sign in it.)
Hi Nicholas
Thanks for the quick reply. Is there a reason then that angular or Umbraco isn't stripping out the character's?
The code I have works for post login and a content get but not a save.
What makes you think Angular isn't stripping out the characters?
Also, it's very hard to know what might be wrong without seeing some of the code you are using.
The article you referenced suggests that Angular will strip out the extra characters as it knows they are there for security.
The 500 error occurs and the error message I have is the one I posted.
It is a java integration with a 3rd party application we are helping with. I can't post all of the code.
This is an example of the JSON we are sending, as you can see the value property contains JSON and this is attempted to be escaped.
------WebKitFormBoundarych03Lqa2pHVQFcOX
Content-Disposition: form-data; name="contentItem"
{"id":1073,"properties":[{"id":59,"alias":"content","value":"{\"name\":\"1 column layout\",
Here is the extra information I found from Wireshark
{"Message":"An error has occurred.","ExceptionMessage":"Unexpected end of MIME multipart stream. MIME multipart message is not complete.","ExceptionType":"System.IO.IOException","StackTrace":" at System.Net.Http.Formatting.Parsers.MimeMultipartBodyPartParser.
What URL are you posting the request to?
/umbraco/backoffice/UmbracoApi/Content/PostSave
I have tried fixes that have worked for others with the same issue, there was even a similar defect logged with Umbraco.
I have tried the permissions on the folders Setting Load User Profile to true in IIS The JSON I am sending back has been validated using JSON Lint
Maybe there is an update to version 7 that contains a fix that I am missing.
This has been fixed by removing the hyphens from the header declaration and having 2 hyphens in the JSON payload boundary declaration.
is working on a reply...