cancel
Showing results for 
Search instead for 
Did you mean: 

Utility HTTP : HTTP Request Pass X-HTTP-Method

NehaBijalwan
Level 2
I'm trying to connect to a REST API using HTTP Request. Ideally, GET and POST methods are working to read/write into a Sharepoint list via REST api. But there is one function that requires to edit an existing item that uses:
X-HTTP-Method: MERGE
If I use POST, it creates a new item but the requirement is to update. Under which parameter of HTTP Request can I pass X-HTTP-Method?

Authorization: "Bearer " + accessToken

Accept: "application/json;odata=verbose"

Content-Type: "application/json"

X-HTTP-Method: "MERGE"

{

  "__metadata": {

    "type": "SP.Data.TestListItem"

  },

  "Status": "In Progress"

}

1 REPLY 1

ewilson
Staff
Staff
Hi @NehaBijalwan,

X-HTTP-Method is a custom HTTP header. My understanding is that you would add that header to the Headers Collection and set its value to Merge. However, the HTTP method you would select on the VBO would actually be a POST. The custom header will notify the server that it needs to handle the Post as a Merge.

Cheers,