is it possible to pass json format in browser's url address bar? (GET method)

15,318

Solution 1

Yes, you certainly can pass JSON in a URL Querystring. You just have to URLencode the JSON string first. As @dmn said, the data is probably better passed via POST because of GET's size restrictions.

Solution 2

The { and } characters are considered unsafe for unencoded use in a URL.

http://www.faqs.org/rfcs/rfc1738.html

Share:
15,318
eros
Author by

eros

University student

Updated on July 26, 2022

Comments

  • eros
    eros almost 2 years

    want to test my url service in browser but need to pass json format data.

    I tried the below but no success: http://locahost:8042/service/getinfo?body={"name":"H&M"}

    or any tool that can be use to pass json formatted test data?

    UPDATES1 I mean is to pass the json formatted data manually in browser's url address bar. Like as my example above. This is for quick testing only not for implementation.