0

What's the best method to pass a set of key/value pairs via a HTTP request?

As an example, say, I need to send a sort command to a RESTful service. I need to specify a list of properties to sort by and the order that I wish to sort each of them by e.g. sort Title by ascending order and then Name by descending order, and so forth for each property.

This is how I am currently building the request:

&sort=Title:ASC,Name:DESC

So, I am delimiting by ":" and then by ",". Is this the best method, in terms of conformance to the RESTful guidelines to pass such data pairs?

Thanks, F.

fin
  • 1,275
  • 4
  • 18
  • 34

1 Answers1

0

depending on the language being used there are multiple methods.

Usually using encode(jsonstring) is the best way, but that also depends on security settings and such ...

boruch
  • 453
  • 3
  • 16