Apr 25 2023 02:32 AM
Like, If I'm trying to call the Batch API
https://xyz.sharepoint.com/sites/abc/_api/$batch
I'm getting response in the text format But I want it to be a JSON
--batchresponse_cdd522a4-cf21-4c48-8b5b-808574047560
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 400 Bad Request
CONTENT-TYPE: application/json;odata=verbose;charset=utf-8
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The property '_test_' does not exist on type 'SP.Data.TDCE136ListItem'. Make sure to only use property names that are defined by the type."}}}
--batchresponse_cdd522a4-cf21-4c48-8b5b-808574047560--
Apr 25 2023 02:38 AM
@Rishabh-Gupta Try passing accept and content-type headers like below with REST API request:
var jsonSPHeaders = {
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 25 2023 03:21 AM