RESTEDClient / RESTED

A REST client for browsers
GNU General Public License v3.0
294 stars 43 forks source link

Make Links clickable and support rfc6570 uritemplates #70

Open dschulten opened 7 years ago

dschulten commented 7 years ago

Links starting with http:// or https:// in a json response should be clickable and become the next request url when clicked. If the clicked link is a URI Template (rfc6570), rested should show a panel to enter the data and store them for the next request.

The template with double moustaches does not follow any standard, it should be kept for compatibility.

eliihen commented 7 years ago

I wasn't aware of any URI template RFC, thanks for that. The double mustaches are mostly just there because they were easy to use with angular.

Right now I'm focused on getting 2.0 out of the gates, but I'll probably have a look at this after the fact. This library may be useful

eliihen commented 7 years ago

I just have one concern with rfc6570. What happens if I have a link like example.com/get_json?json={"foo":"bar"}? People would most likely be very confused if the extension simply stripped it away.

I think it would be best if unknown expansion keys were simply left alone. The library I linked does not do this, it removes any unknown expansions.

dschulten commented 7 years ago

the value of json has to be urlencoded, so the server receives the following: /get_json?json=%7B%22foo%22%3A%22bar%22%7D If you enter your url in the address bar, the browser encodes the url as shown above

An api containing links would have to encode the link in the same way to make it a valid dereferenceable url. Hence, if someone clicked it in rested, you wouldn't find a curly bracket, no risk to mistake a link for a uritemplate.

dschulten commented 7 years ago

👍