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

URL path variables are not replaced if followed by a dot #4423

Closed
ghost opened this issue Apr 6, 2018 · 13 comments
Closed

URL path variables are not replaced if followed by a dot #4423

ghost opened this issue Apr 6, 2018 · 13 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Apr 6, 2018

App Details:

Postman for Windows
Version 6.0.10
win32 6.1.7601 / x64

Issue Report:

  1. Did you encounter this recently, or has this bug always been there:
    Always

  2. Expected behaviour:
    URL parameter is replaced

  3. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app):

GET
https://example.com/api.ashx/v2/threaddata/:threadId.json
  1. Screenshots (if applicable)

Enter the URL https://example.com/api.ashx/v2/threaddata/:threadId.json
Set the threadId parameter to 1234
Click Send
Observe that URL parameter is not replaced

I would expect there to be some way of wrapping the parameter name.
I tried using {{threadId}}, :{threadId}, :threadId: and {:threadId} but none of these worked.

@harryi3t
Copy link

harryi3t commented Jun 29, 2018

@errorx666 Will it be possible for you to use environment, global or collection variables instead of path variables? That is the more recommended way of using variables.

@ghost
Copy link
Author

ghost commented Jun 29, 2018

It would be very inconvenient to do so, as threadId would need to change frequently (each request).

I'm working with a platform (Telligent Community Server) that uses this URL format for all of its APIs: .json suffix for a JSON response, .xml suffix for an XML response.

@kamalaknn
Copy link
Member

Hi @errorx666

We could see two parts to this issue.

  1. The variable in URL https://example.com/api.ashx/v2/threaddata/:threadId.json is not replaced. We will look into this. But since there is no proper specification on this format of templating there could be more of these scenarios that aren't defined how it should behave.
  2. The alternative is to use the {{variable}} syntax. To use them you have to define the variable in environment, collection or globals. We are trying to improve the experience working with environments with sessions and other improvements. Please have a look.

Thanks.

@kamalaknn kamalaknn changed the title URL parameters ignored if followed by a dot URL path variables are not replaced if followed by a dot Jul 2, 2018
@ghost
Copy link
Author

ghost commented Jul 2, 2018

These are possible workarounds. It feels less "correct" to me to change globals or the environment in order to pass a parameter to a single query.
Further, this scales extremely poorly. I'm going to end up with a global variable for each possible query parameter across all queries, and each variable will only be applicable to a few queries.

@shamasis
Copy link
Member

shamasis commented Jul 4, 2018

@errorx666 - there is a bug that the path variable with trailing . - however there are two issues:

  1. The path variable name is free-form (i.e. there is a start identifier, but no end-identifier)
  2. There is no definite way to isolate the variable name from URL without making some assumptions.

I suggest we set some assumptions and for anything else recommend using double braces standard that is everywhere else in Postman.

@numaanashraf
Copy link
Member

@errorx666 This seems related to #2427. I'm closing this and let's continue this discussion on the original issue.

@agaonkar-cleo
Copy link

Do we have a solution for this problem? I am also facing the same problem.

@SzymonDukla
Copy link

Same here, apparently it was fixed in 7.2.0 but now is again broken

@codenirvana
Copy link
Member

@agaonkar-cleo @SzymonDukla Can you share steps to reproduce this issue?

Not reproducable in v7.8.0:

Screenshot 2019-10-02 at 6 24 48 PM

@codenirvana codenirvana self-assigned this Oct 2, 2019
@ghost
Copy link
Author

ghost commented Oct 3, 2019

@codenirvana I can see the issue in your screenshot. The path variable name should be get, not get.json, and the URL should end in .json

@jayarjo
Copy link

jayarjo commented Jun 12, 2020

This issue is still actual

1 similar comment
@Lechus
Copy link

Lechus commented Nov 13, 2020

This issue is still actual

@jjercx
Copy link

jjercx commented Sep 8, 2021

Yes, can this be reopened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests