-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update list item Rest API: fixed the content-type value #6661
base: main
Are you sure you want to change the base?
Conversation
… item - updated the doumentation with the correct value
Docs Build status updates of commit 5a5ed8b: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
I'm not sure this fix is correct... can you confirm this with an example? The |
I understand what you are saying about the content-type header but the API returns a 400 if odata=verbose is not sent as part of the header. The error message returned is '__metadata does not exist on type 'SP.Data.DataItem' The rest API seems to be expecting that value in the header Jerry has also provided an example here in the original issue: #6636 (comment) Other similar API calls expect this value for the content-type header as well, such as Create List Item, Delete List Item and a few others. This is just a guess but from what I am reading this could have been done to support the Verbose JSON format in the OData 3.0 spec. More about this here (you are likely already familiar but just in case): Odata 3.0 spec discussing the json verbose format: https://www.odata.org/documentation/odata-version-3-0/json-verbose-format/ Based on what I read, it may have been done to support sending the __metadata as part of the request? FWIW, I tried with odata=minimalmetadata and that resulted in the same error. Thanks! |
@andrewconnell - just making sure you were able to review my earlier response. Please let me know if I can further assist in any other way. Thank you! |
I haven't looked at it... I help with triaging the issues & managing PR's, but only the quick stuff. Things that need more research, I do that in my spare time and been swamped lately. Can't make a commitment when I'll get back to this thread, or when MSFT will pick it up. |
The content-type for the Update list item REST API was incorrect in the documentation example here. This PR fixes the example
Category
Related issues
What's in this Pull Request?
Updated the content-type header value in the example to the correct value:
"application/json;odata=verbose"
, instead of:"application/json"
, which does not work.