cancel
Showing results for 
Search instead for 
Did you mean: 

The specified HTTP method is not allowed for the resource identified by the Data Service Request URI

Former Member
0 Kudos

Hi,

i am trying to use POST method for sending updates to SAP from GW.

1) i have used GET parameter to fetch the XCSRF token, which is successful.

2) i would like to use POST method for updating one of the field in SAP, for which i am getting the below error.

The specified HTTP method is not allowed for the resource identified by the Data Service Request URI


3) i tried using PUT method which is successful.

below is the URL and payload and content type i am using to for POST method.

Content-type : multipart/mixed; boundary=batch

URL :http://:/sap/opu/odata/SAP/Z_POC_READ_UPDATE_SRV/ZREADUPDATESet(ImVbeln='0000004969')

--batch

Content-Type: multipart/mixed; boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST ZREADUPDATESet HTTP/1.1

Content-Type: application/atom+xml

Content-Length: 975

<?xml version="1.0" encoding="utf-8"?>

<atom:entry xmlns:atom="http://www.w3.org/2005/Atom">

<atom:content type="application/xml">

<m:properties

xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

    <m:properties>

     <d:ImAuart/>

     <d:ImErnam/>

     <d:ImLifsk/>

     <d:ImSpart/>

     <d:ImTrvog>1</d:ImTrvog>

     <d:ImVbeln>0000004969</d:ImVbeln>

     <d:ImVkorg/>

     <d:ImVtweg/>

    </m:properties>

</atom:content>

</atom:entry>

--changeset--

--batch--

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear All,

i could resolve the issue if i use Create method to update the records in SAP and used the below URI

http://:/sap/opu/odata/SAP/Z_POC_READ_UPDATE_SRV/ZREADUPDATESet/$batch

Answers (2)

Answers (2)

Former Member
0 Kudos

Please, just do it right and stop making up your own protocols...

JyotiD
Active Participant
0 Kudos

HI Madhav,

Update you should use PUT method, POST is to create.
It looks your requested URL is wrong.

Put- http://:/sap/opu/odata/SAP/Z_POC_READ_UPDATE_SRV/ZREADUPDATESet(ImVbeln='0000004969')

Post - http://:/sap/opu/odata/SAP/Z_POC_READ_UPDATE_SRV/ZREADUPDATESet

There will be multiple documents related to this. Have a look into this once.

Regards,

Tarun