Skip to Content
0
Jun 20, 2022 at 05:37 AM

405 Error in POST call : SAP CPI Odata V2

152 Views

Hello Folks,

I have a scenario in CPI in which i need to read data from an excel file and POST a batch operation on S/4 Hana system.

For POST to S4 system i am using Purchase Contract API (Standard API from API business HUB)

Link : https://api.sap.com/api/API_PURCHASECONTRACT_PROCESS_SRV_0002/resource

Issue : While trying to do POST i am getting 405 method not allowed error. I amusing contetct type as multipart/mixed; boundary=batch

And payload is in below format :

--batch

Content-Type: multipart/mixed;boundary=changeset

--changeset

Content-Type: application/http

Content-Transfer-Encoding: binary

POST A_PurchaseContract HTTP/1.1

Content-Type: application/json

Accept: application/json

sap-context-accept: header

{ -sample body-}

--changeset--

--batch--

i checked that POST batch operations are allowed on the API. Can you please suggest what am i missing?