I am doing the POST operation from Postman tool to SharePoint online list but getting the 400 bad request the request cannot be fulfilled due to bad syntax error.

Here are my configuration in Postman tool:

URL:

https://globalsharepoint2019.sharepoint.com/sites/SharePointRND/_api/Web/Lists/GetByTitle('TestList')/Items

Raw Request Body:

Raw request body

Headers Parameters:

Headers Parameters

POST request status: 400 bad request the request cannot be fulfilled due to bad syntax

400 bad request the request

Anyone could help me - what is the bad syntax error here?

有帮助吗?

解决方案

In order to include the "__metadata" object in your POST, you need to specify your content-type as "application/json;odata=verbose".

Alternatively, if you need to use the "application/json;odata=minimalmetadata" content-type, remove the whole "__metadata" json object, and instead specify the "ContentTypeId" in your body just like you are doing for your "Title", but you would need to first look up the ID of your TestListListItem ContentType.

许可以下: CC-BY-SA归因
scroll top