Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get query param as HashMap

I want to be able pass to my server a GET request suh as:

 http://example.com/?a[foo]=1&a[bar]=15&b=3

And when I get the query param 'a', it should be parsed as HashMap like so:

{'foo':1, 'bar':15}

EDIT: Ok, to be clear, here is what I am trying to do, but in Java, instead of PHP:

Pass array with keys via HTTP GET

Any ideas how to accomplish this?

like image 900
Martin Avatar asked Mar 04 '13 08:03

Martin


1 Answers

You can pass JSON Object as String by appending it to URL. But befor that you need to encode it you can use the method given in this link http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_restful_encodingUtil.htm for encoding and then just append the json object as any other string

like image 110
Kishor Raskar Avatar answered Sep 24 '22 07:09

Kishor Raskar