-
Notifications
You must be signed in to change notification settings - Fork 839
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
URL segment parameters #85
Comments
@datashaman Can you give an example how Postman can help there? Are you talking about Rails controllers? Segments in the URL can be interpreted to be anything by the host system. Postman can not know in advance about the backend system running behind the API. |
I'm suggesting that there be another mode of parameter entry, which matches URL segments. For example, entering the URL:
would automatically create a separate entry list for URL parameters (much the same as query params), with the key being id (filled in from the URL pattern above) and the value being entered by the user. This would allow saving and reusing requests with REST URL segments. This is also backend agnostic, but it's a backend pattern which is used by all REST-based systems. |
Ok. Makes sense now. Let me think of a way to integrate this into the Postman request sending flow. |
+1, this would be great! |
+1, very essential to the work I am doing too. |
+1 for this feature since this is pretty much needed for many REST API. Thank you Some thought to solve this. Image illustration |
+1 to this. sorry for making a duplicate ticket. What I suggested was to make the syntax similar to environment variables, using {{ }} in the url, that way the syntax is similar and postman would mix the environment variables + request specific variables into the url solving. for example: http://{{HOST}}/api/v1/users/{{USER}} HOST would be environment, USER would be request specific. Anyway, I would be happy with any implementation of this :P |
A new pledge is available on this issue: https://www.catincan.com/bounty/https-github-com-a85-postman-chrome-extension-issues-85 . |
Update: Started work on this finally. |
Added to dev-v2 branch. Will be available in v0.9.4! |
I'm currently on v0.9.5, but still can't find the support for this amazing feature...? Am I missing something? Great app btw!!! |
@thobiaskarlsson Just use paths prefixed with a colon. On opening URL params, additional params will show up. I need to make this more apparent though. |
Thanks, it works like a charm. One thing though, it would be much better if you could default to an environment/global property if not set in "request scope". Optional implementation: |
I'm unable to get this feature to work in the Packaged App v0.9.9.7. It would be the key feature for collections for me. |
@pdelre An update has been pushed on the Web Store with the fix. The version number should be v0.9.9.9 |
Unifying the way segments and environment variables work would make sense.
|
@a85 Thanks. I see how it added the URL Param, but it doesn't seem to be doing the string replacement in either Send or Preview. |
I can confirm this issue is happening in 0.9.9.9 |
@a85 Is there any way to disable this feature? We built an API that uses colon characters at the beginning of a segment to access resource metadata. For example GET /:models. Postman replaces ":models" with empty string in this case. Would you consider passing the original string if no param value is provided to replace it? |
@ericingram, as a workaround, have you tried setting the variable value to ":whatever"? |
I would suggest the easiest approach around this is to rather pass through So in your case, if there's nothing to substitute for :models, then it In other cases, where a parameter exists, use the parameter. On 25 August 2015 at 15:18, Eric [email protected] wrote:
|
@datashaman, what if someone actually wants to leave that value blank? The way I see it, ":anything" is a variable. If you want the value to be ":anything", it's best to set it explicitly. |
The problem is there's no way to escape that ':' so it is not recognized as On 27 August 2015 at 19:45, Aniket Panse [email protected] wrote:
|
Not sure what you mean by "there's no way to escape that ':' so it is not recognized as a placeholder". I was able to send a request to "/:var" with this setup: This is my server code:
and this is the output, which shows that the request was caught on the "/:var" path.
What escaping functionality is needed here? |
Uh, my bad. I'm misunderstanding the problem. It's not one of escaping, it's of selective replacement of the parameter, but as you've said what if it should be blank. Perhaps a special 'blank' token? But then you need a way to escape that because the 'blank token' might ALSO be a legit parameter in some weird situation. Token-ception. :) |
i'm doing a pre-request script and i noticed that |
@pvsune The pre-request script does not have variables resolved. You can try changing the You can then use a little regex to replace the variable yourself -
|
thanks @abhijitkane i thought there's a prettier way |
I've been wanting this feature for ages <3 |
@abhijitkane Do you think in the future there will be a way to access the path variables as the environment variables from the pre-request scripts? |
+1. Would be very useful. |
Can we modify the search pattern to not require a leading slash? My company is working with an api specification that requires url segments with parameters be formatted as EDIT: It would be better to make the pattern accept either leading slashes or equals symbols ( |
Rails routing and pretty much most other REST-based systems use segments in the URL to convey context and parameters to the controller. It does not appear possible to do this using POSTMan, which cuts out a large portion of your core users.
The text was updated successfully, but these errors were encountered: