Reputation: 5826
I need to send the json object in get request. I installed chrome Postman extension but i am not getting how can i send json object in GET request ?
Postman provides the way to send json data in Post request by adding the header as application/json and then add the json data under raw form. How to send the json data in GET request ? Do i need to append it in URL ?
Upvotes: 4
Views: 15854
Reputation: 376
In POSTMAN you can send body data in GET request. If you try to append in the URL using url encoding you will get error.
Try to convert json object into string and send it in the URL parameters and see if it works.
Also if your backend server allows only to send data as URL parameters and your URL is long (i.e approx 2048 characters) then I am not sure whether this will work.
If above solution doesn't work then I think you can achieve this using curl. CURL is a tool for doing all sorts of URL manipulations and transfers. You can generate cURL code using Postman. Here is the reference
Upvotes: 0
Reputation: 108
You can use google chrome Postman Extension
it allows you to send and see any type of data.
Upvotes: -1
Reputation: 4907
It's bad solution to send any objects using get request. But you can send it as a url parameter using url encoding:
String url = "http://example.com/query?json=" + URLEncoder.encode(json, "UTF-8");
Upvotes: 2