Skip to Content
0

OData read Query

Nov 29, 2016 at 09:25 PM

108

avatar image
Former Member

Hello folks,

I am trying to pass a string to my OData entity set like this:

string => loginId=10136299;firstName=NINA;lastName=TAYLOR;email=NINA_MA@GMAIL.COM;timestamp=1480454194618;accounts=1120763566772|3432

So, If I pass input to my URL like (2 types), it works perfect :

http://xxxxxx.xxxxx.com:8030/sap/opu/odata/sap/ZENCRYPTION_SRV/EncryptSet('Saumil') OR

http://xxxxxx.xxxxx.com:8030/sap/opu/odata/sap/ZENCRYPTION_SRV/EncryptSet(IString='Saumil')

*IString is input parameter of the entity set.

But if I pass the above string to my Odata, it says bad request:

http://xxxxxx.xxxxx.com:8030/sap/opu/odata/sap/ZENCRYPTION_SRV/EncryptSet(IString='loginId=10136299;firstName=NINA;lastName=TAYLOR;email=NINA_MA@GMAIL.COM;timestamp=1480454194618;accounts=1120763566772|3432')

, I think that the '=' sign is causing trouble here.

My only aim is to pass the string at the top to my URL in single quotes.

Any help/questions would be greatly appreciated!!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Krishna Kishor Kammaje
Dec 04, 2016 at 07:54 AM
0

What are you trying to achieve by passing all those parameters in URL?

You can only pass Entity's keys inside parenthesis. (For Read and Update).

If you are trying to do an Update, all properties need to be passed as request body, not in the URL.

I would suggest you to go through http://www.odata.org/documentation/odata-version-2-0/operations/ to understand each operation.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 08, 2017 at 02:58 PM
0

Hi Guys,

I am very new to OData and SAPUI5. I looking for a help to how to pass very long string or as url parameter when making a OData get request. My query queryString or parameter will be a csv file data in specific format which I need to pass when I making a OData call. Is it good practice to pass as long querystring as url parameters when making a OData call or should it be a post request? Could it be as simple as where queryString = "custom1=value1&custom2=value2 ..........."

var oModel =new sap.ui.model.odata.ODataModel("http://myserver/MyService.svc/?queryString");
Share
10 |10000 characters needed characters left characters exceeded