Jsoneditor: Is it possible to send json via http get request ?

Created on 2 Nov 2016  路  6Comments  路  Source: josdejong/jsoneditor

Hi,

I was wondering if it's possible to paste some GET URL to your editor to be able to paste the JSON data into the viewer. I have simple scenario that i would like to implement with python :

  1. Make API request and get json response
  2. Take this JSON response and with python -m webbrowser -t "http://jsoneditoronline.org?{JSON}" open your editor in the browser automatickally

In that way i would avoid all the copy-pasting and just run one script that would do all the work for me.

Thanks.

question webapp

Most helpful comment

Yes you can do that with a query parameter json, for example:

http://jsoneditoronline.org/?json={%22name%22:%22John%22,%22age%22:32}

See docs: http://jsoneditoronline.org/doc/index.html#query_parameters

All 6 comments

Yes you can do that with a query parameter json, for example:

http://jsoneditoronline.org/?json={%22name%22:%22John%22,%22age%22:32}

See docs: http://jsoneditoronline.org/doc/index.html#query_parameters

Perfect, thank you so much :)

:+1:

But in GET request, the length of a URL is limited (maximum URL length is 2048 characters)

That's correct. The maximum url length varies per browser but is about 2000 bytes in worst case. For larger documents you could upload your JSON file at some public url yourself, and pass the url:

http://jsoneditoronline.org/?url=...

See docs: http://jsoneditoronline.org/doc/index.html#query_parameters

@BrunyC I don't understand what you mean.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ppetkow picture ppetkow  路  8Comments

cope picture cope  路  8Comments

bnewcomer picture bnewcomer  路  6Comments

CodeVam picture CodeVam  路  3Comments

tanmayrajani picture tanmayrajani  路  4Comments