Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

Do we care about pretty query strings? #1

Description

@leevigraham

Possibilities:

Concatenated strings

Example ?ids=1,2,3,4,5

Pros:

  • pretty in documentation

Cons:

  • Manual construction (implode()) and parsing (explode())
  • Not flexible for deeper arrays

Serialised arrays

Example ?ids[]=1&ids[]=2&ids[]=3

Pros:

  • Allows for complex filters
  • Standard URL behaviour
  • Easily constructed / digested
  • Symfony2 param convertors expect arrays from query strings

Cons:

  • Longer URLS
  • Not human readable

Encoded JSON

Example ?q={"ids": [1,2,3,4,5]}

Pros:

  • Readable ?

Cons:

  • Never seen it done before
  • Requires custom parsing
  • Seems weird

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions