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

asking for multiple fragments from the same resource

Expand Messages
  • phpwalter
    I have this resource... example.com/my/api/32 It returns n pieces of data. I want to return only one data_q ... example.com/my/api/32#data_q easy enough.
    Message 1 of 3 , Feb 3, 2014
    • 0 Attachment
      I have this resource...


      example.com/my/api/32

      It returns 'n' pieces of data. I want to return only one "data_q"...

      example.com/my/api/32#data_q

      easy enough. But what, in your view, should done if I want 3 pieces of data?

      I really don't think this is kosher...
      example.com/my/api/32#data_a#data_q#data_z
      I really do't think asking for multiple fragments constitutes a query...
      example.com/my/api/32?data=data_a,data_q,data_z

      I would love to hear your ideas.

      Thank you

      Walter
    • William Riley-Land
      My understanding is that the GET request is your query, and that the query string is for modifying the query. It seems like what you are doing is very
      Message 2 of 3 , Feb 3, 2014
      • 0 Attachment
        My understanding is that the GET request is your query, and that the query string is for modifying the query.  It seems like what you are doing is very similar, if not exactly filtering the query to certain instances, and therefor the query string would be the most appropriate avenue for expressing that modification of the query.  

        William P. Riley-Land
        http://linkedin.com/in/willprl
        Scalable API Engineer / Owner
        Kun.io App Studio LLC
        http://kun.io/
        (573) 823-2607

        On Feb 3, 2014, at 11:50 AM, <phpWalter@...> <phpWalter@...> wrote:

        I have this resource...




        It returns 'n' pieces of data. I want to return only one "data_q"...


        easy enough. But what, in your view, should done if I want 3 pieces of data?

        I really don't think this is kosher...
        I really do't think asking for multiple fragments constitutes a query...

        I would love to hear your ideas.

        Thank you

        Walter


      • Matt McClure
        Some rules of thumb that might help: 1. Fragments are for client-side use. In general, the client shouldn t send the fragment portion of the URL to the server.
        Message 3 of 3 , Feb 5, 2014
        • 0 Attachment
          Some rules of thumb that might help:

          1. Fragments are for client-side use. In general, the client shouldn't send the fragment portion of the URL to the server.
          2. Query strings are for both clients and servers. The server can expect the client to compose a query string from many parts.
          3. URI paths are for servers. The client should treat the path portion as opaque and avoid parsing it or composing it.
          4. There's a convention mentioned in RFC 3986 indicating to use ';' to separate the hierarchical portion of a URI path from a non-hierarchical part. Both parts remain opaque to the client; the distinction should only be meaningful to the server.


          On Mon, Feb 3, 2014 at 12:50 PM, <phpWalter@...> wrote:
           

          I have this resource...



          It returns 'n' pieces of data. I want to return only one "data_q"...


          easy enough. But what, in your view, should done if I want 3 pieces of data?

          I really don't think this is kosher...
          example.com/my/api/32#data_a#data_q#data_z
          I really do't think asking for multiple fragments constitutes a query...
          example.com/my/api/32?data=data_a,data_q,data_z

          I would love to hear your ideas.

          Thank you

          Walter




          --
          Matt McClure
          http://matthewlmcclure.com
          http://www.mapmyfitness.com/profile/matthewlmcclure
        Your message has been successfully submitted and would be delivered to recipients shortly.