Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8652

Re: Manage multi-table insert using OData Service

$
0
0

Hi Thomas,

 

Thank you I did what you have suggested and I am able to insert record.

 

Now I am working on batch request.

 

Request header in Postman :

 

Authorization : Basic ZHAxMTMxNzpBcXVlbnQwNQ==

Content-Length : 673

X-CSRF-Token : Fetch

DataServiceVersion : 2.0

MaxDataServiceVersion : 2.0

Content-Type : multipart/mixed; boundary=batch

 

 

Request body in Postman:

 

--batch  

Content-Type:multipart/mixed; boundary=changeset

Content-Transfer-Encoding:binary

      

--changeset

Content-Type:application/http

Content-Transfer-Encoding:binary

Content-ID: 1

      

POST PersonBean HTTP/1.1

Content-Type: application/json

{"PERS_ID":"0000000000","FIRSTNAME":"test from service","LASTNAME":"Test from Service","E_MAIL":"testfromservice@gmail.com"}

Content-Length: 500 

 

 

--changeset 

Content-Type:application/http

Content-Transfer-Encoding:binary    

Content-ID: 2

 

 

POST AddressBean HTTP/1.1

Content-Type:application/json

{"ADDRESS_ID":"0000000000","ADDRESS_TEXT1":"Test address1","ADDRESS_TEXT2":"Test address2","CITY":"Test city","STATE":"Test state","COUNTRY":"Test country","ZIP":"Test zip","PERS_ID":"1"}

Content-Length:500

 

 

--changeset--      

     

--batch--

 

When I hit this request I am getting following error

 

--2A9AD779874CC08DD7FE41139044E60B0

Content-Type: application/http

Content-Length: 302

content-transfer-encoding: binary

 

 

HTTP/1.1 400 Bad Request

Content-Type: application/xml;charset=utf-8

Content-Length: 208

 

 

 

 

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

<error

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

    <code/>

    <message xml:lang="en-US">Invalid multipart entry.</message>

</error>

--2A9AD779874CC08DD7FE41139044E60B0--

 

In addition to this I am not sure how to get X-CSRF-Token in postman.

 

Please advice.


Viewing all articles
Browse latest Browse all 8652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>