Skip to Content
avatar image
Former Member

OData read Query

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 :'Saumil') OR'Saumil')

*IString is input parameter of the entity set.

But if I pass the above string to my Odata, it says bad request:'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!!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Dec 04, 2016 at 07:54 AM

    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 to understand each operation.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 08, 2017 at 02:58 PM

    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");
    Add comment
    10|10000 characters needed characters exceeded