Loading ...
Sorry, an error occurred while loading the content.

Using jdon serialized objects as query params

Expand Messages
  • Unmesh Joshi
    Hi, I am working with a couple of services where GET request is used for search and some associative data needed to be passed as query params.
    Message 1 of 4 , Jun 5, 2013
    • 0 Attachment
      Hi,

      I am working with a couple of services where GET request is used for search and some associative data needed to be passed as query params. 

      api.search.com/search?q=[{"id":"id1", "yd2":"p1"},{"id":"id2", "yid":"p2"}]
      They are passing these id maps as json serialized query params.

      Here is another example, where category maps are passed as json serialized maps.

      Are there more such examples? 

      Is this a standard practice? 

      Are there example APIs where POST is used instead of GET just because the URLs and parameters are getting too long?

      Thanks,
      Unmesh

    • Eric J. Bowman
      ... I m sure it s a common practice; what REST wants is a standardized means of building such URIs. What do the hypertext controls look like, and what media
      Message 2 of 4 , Jun 5, 2013
      • 0 Attachment
        Unmesh Joshi wrote:
        >
        > Is this a standard practice?
        >

        I'm sure it's a common practice; what REST wants is a standardized
        means of building such URIs. What do the hypertext controls look like,
        and what media type are you using? As to the URI itself, it's opaque,
        so you could even use "jdon" notation for query params... ;-)

        -Eric
      • Unmesh Joshi
        Message 3 of 4 , Jun 5, 2013
        • 0 Attachment
          :-). you surely can use "jdon" if its standardized.


          On Wed, Jun 5, 2013 at 7:09 PM, Eric J. Bowman <eric@...> wrote:
          Unmesh Joshi wrote:
          >
          > Is this a standard practice?
          >

          I'm sure it's a common practice; what REST wants is a standardized
          means of building such URIs.  What do the hypertext controls look like,
          and what media type are you using?  As to the URI itself, it's opaque,
          so you could even use "jdon" notation for query params...  ;-)

          -Eric

        • Eric J. Bowman
          ... For URI syntax it just doesn t matter, except on POST where you d want the equivalent of application/x-www-form-urlencoded to inform the origin server and
          Message 4 of 4 , Jun 5, 2013
          • 0 Attachment
            >
            > :-). you surely can use "jdon" if its standardized.
            >

            For URI syntax it just doesn't matter, except on POST where you'd want
            the equivalent of application/x-www-form-urlencoded to inform the
            origin server and any participating intermediaries, how to decode the
            payload. On GET, the query isn't "payload" it's just an opaque URI,
            IMO.

            -Eric
          Your message has been successfully submitted and would be delivered to recipients shortly.