[GH-ISSUE #1842] Body is not stored at query vars when using "Copy link" feature #588

Closed
opened 2026-03-16 16:10:23 +03:00 by kerem · 8 comments
Owner

Originally created by @manuman94 on GitHub (Sep 29, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1842

Originally assigned to: @mandaputtra on GitHub.

Describe the bug
I would like to use the Hoppscotch query string API to build Hoppscotch links in my application so we can debug REST calls from our HTTP test reports.

The idea behind is to make a "Play" button in our reports that link to a pre-filled Hoppscotch API tester. We already can do this but we can only fill "parameters" (query string), "headers", "method", and "endpoint". There is no such "body" parameter to pre-fill the body of the request.

To Reproduce
Open a new Hoppscotch session and fill endpoint, method, headers, parameters and body. You will see that the link at the address bar will include all of those information but the body part.

Expected behavior
Include "body" parameter with the url-encoded body value.

Additional context
I don't know if this is a bug report or a feature request since I don't know if this is made on purpose. But it seems weird for us that such as an important part as the body is not present at the Hoppscotch query vars API.

Thank you, greetings.

Originally created by @manuman94 on GitHub (Sep 29, 2021). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1842 Originally assigned to: @mandaputtra on GitHub. **Describe the bug** I would like to use the Hoppscotch query string API to build Hoppscotch links in my application so we can debug REST calls from our HTTP test reports. The idea behind is to make a "Play" button in our reports that link to a pre-filled Hoppscotch API tester. We already can do this but we can only fill "parameters" (query string), "headers", "method", and "endpoint". There is no such "body" parameter to pre-fill the body of the request. **To Reproduce** Open a new Hoppscotch session and fill endpoint, method, headers, parameters and body. You will see that the link at the address bar will include all of those information but the body part. **Expected behavior** Include "body" parameter with the url-encoded body value. **Additional context** I don't know if this is a bug report or a feature request since I don't know if this is made on purpose. But it seems weird for us that such as an important part as the body is not present at the Hoppscotch query vars API. Thank you, greetings.
Author
Owner

@liyasthomas commented on GitHub (Sep 29, 2021):

Hi @manuman94, thanks for reporting this issue. We'll be looking into fixing this as soon as possible.

<!-- gh-comment-id:930274803 --> @liyasthomas commented on GitHub (Sep 29, 2021): Hi @manuman94, thanks for reporting this issue. We'll be looking into fixing this as soon as possible.
Author
Owner

@mandaputtra commented on GitHub (Oct 1, 2021):

I can take this issue if no one already work on this.

<!-- gh-comment-id:931880892 --> @mandaputtra commented on GitHub (Oct 1, 2021): I can take this issue if no one already work on this.
Author
Owner

@liyasthomas commented on GitHub (Oct 1, 2021):

Hi @mandaputtra, you're free to take this issue. I'm assigning it to you, do let us know if you need any help.

<!-- gh-comment-id:931881483 --> @liyasthomas commented on GitHub (Oct 1, 2021): Hi @mandaputtra, you're free to take this issue. I'm assigning it to you, do let us know if you need any help.
Author
Owner

@mandaputtra commented on GitHub (Oct 1, 2021):

Can you point me where you parse and set the query param on url bar?, I've lost track of it in here I can't find the code who responsible for updating the url bar.

<!-- gh-comment-id:931956527 --> @mandaputtra commented on GitHub (Oct 1, 2021): Can you point me where you parse and set the query param on url bar?, I've lost track of it in [here](https://github.com/hoppscotch/hoppscotch/blob/main/packages/hoppscotch-app/components/http/Parameters.vue) I can't find the code who responsible for updating the url bar.
Author
Owner

@liyasthomas commented on GitHub (Oct 1, 2021):

Hi @mandaputtra, check out the below file on setting the request object to query parameters.
github.com/hoppscotch/hoppscotch@0f39d54c3c/packages/hoppscotch-app/helpers/types/HoppRESTRequest.ts (L83)

<!-- gh-comment-id:931965370 --> @liyasthomas commented on GitHub (Oct 1, 2021): Hi @mandaputtra, check out the below file on setting the request object to query parameters. https://github.com/hoppscotch/hoppscotch/blob/0f39d54c3c669089e6639dd91904fb62b911945e/packages/hoppscotch-app/helpers/types/HoppRESTRequest.ts#L83
Author
Owner

@mandaputtra commented on GitHub (Oct 1, 2021):

Sorry to bother you again @liyasthomas 😄 I'm still confuse how do you change the query params on url bar here.

Screenshot from 2021-10-01 16-21-34

I see it binds on params$ but I dont see why It change the query parameters on the bar.

<!-- gh-comment-id:932071458 --> @mandaputtra commented on GitHub (Oct 1, 2021): Sorry to bother you again @liyasthomas :smile: I'm still confuse how do you change the query params on url bar here. ![Screenshot from 2021-10-01 16-21-34](https://user-images.githubusercontent.com/23342943/135597008-8fb59a92-e6bb-4cc3-803e-aad514fb89ab.png) I see it binds on `params$` but I dont see why It change the query parameters on the bar.
Author
Owner

@liyasthomas commented on GitHub (Oct 1, 2021):

Hi @mandaputtra, the code block you're looking for is this:

github.com/hoppscotch/hoppscotch@8f0538c886/packages/hoppscotch-app/pages/index.vue (L165-L171)

QUICK NOTE: Read this article on StackOverflow to understand the limit of characters allowed in URL: What is the maximum length of a URL in different browsers?

<!-- gh-comment-id:932137222 --> @liyasthomas commented on GitHub (Oct 1, 2021): Hi @mandaputtra, the code block you're looking for is this: https://github.com/hoppscotch/hoppscotch/blob/8f0538c886e5fe00e4db2cf24c842a4d8d9f744c/packages/hoppscotch-app/pages/index.vue#L165-L171 QUICK NOTE: Read this article on StackOverflow to understand the limit of characters allowed in URL: [What is the maximum length of a URL in different browsers?](https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers)
Author
Owner

@manuman94 commented on GitHub (Oct 4, 2021):

Thank you guys! This is awesome. Working pretty well and so fast!

Greetings.

<!-- gh-comment-id:933245380 --> @manuman94 commented on GitHub (Oct 4, 2021): Thank you guys! This is awesome. Working pretty well and so fast! Greetings.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#588
No description provided.