Adding JSON string in Query parameter of target URL

Not applicable

How to add a JSON string in Query paramater of target URL.

I tried doing it using javascript to stringify it but it didn't work. There were lot of these %% symbols in the target URL.

for example

https://example.com/restapi?entity={"foo":"bar", "hi":"hello"}

0 2 7,108
2 REPLIES 2

@Vandana Prasad G , I don't think it's a great API design !! What exactly your API is doing ? Are you creating some entity / searching some entity ? Can you give more context about your API ?

-------------------------------

Anil Sagar

5997-screen-shot-2017-11-23-at-75916-pm.png Learn Apigee Concepts in 4 Minutes HandsOn

I'd suggest that you do either:

  • make it a POST call and pass the JSON payload in the HTTP body
  • encode the parameters as query: fo=bar&hi=hello

One of those two options ought to work.