Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed json in a query string #1578

Open
1 task done
musjj opened this issue May 21, 2024 · 0 comments
Open
1 task done

Embed json in a query string #1578

musjj opened this issue May 21, 2024 · 0 comments
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!

Comments

@musjj
Copy link

musjj commented May 21, 2024

Checklist

  • I've searched for similar feature requests.

Enhancement request

Embed JSON in a query string for GET requests.


Problem it solves

I'm trying to use the httpie CLI tool to quickly test out my tRPC backend and it works well for POST requests. But for GETs, tRPC requires you to embed the data as a JSON string in a query param like this:

myQuery?input=${encodeURIComponent(JSON.stringify(input))}

It would be nice if there's a syntax that can support this kind of use case. Maybe it can look something like this:

http GET https://localhost:3000/myQuery input[foo]===bar
GET myQuery?input=%7B%22foo%22%3A%22bar%22%7D HTTP/1.1
@musjj musjj added enhancement New feature or enhancement new Needs triage. Comments are welcome! labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!
Projects
None yet
Development

No branches or pull requests

1 participant