REST item update request - 302 redirect, then returns HTML update page

540
1
Jump to solution
01-29-2018 09:06 AM
TyroneLigon1
New Contributor III

I'm trying to edit a Portal item through the REST interface. When the request is submitted, I get a 302 response, then a 200 response with the item update HTML page as the response body. I was expecting a JSON response with the result of the update request (item ID and success or failure). The code is on an intranet, but I attached an XMLHttpRequest code snippet. Am I doing something wrong?

1 Solution

Accepted Solutions
TyroneLigon1
New Contributor III

The solution was to set a request header ('Content-Type', 'application/x-www-form-urlencoded') and instead of sending a stringified JSON parameter object, send a parameter string ('f=json&title=a title&description=a description...').

View solution in original post

1 Reply
TyroneLigon1
New Contributor III

The solution was to set a request header ('Content-Type', 'application/x-www-form-urlencoded') and instead of sending a stringified JSON parameter object, send a parameter string ('f=json&title=a title&description=a description...').

View solution in original post