postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.85k stars 841 forks source link

Postman import cURL is not reflecting the actual string pasted. #13208

Closed leognmotta closed 1 month ago

leognmotta commented 1 month ago

Is there an existing issue for this?

Describe the Issue

if I paste this exact string to be imported in postman:

curl -X GET "https://api.quickbase.com/v1/apps/some_id_here" -H 'Accept:application/json, text/plain, */*' -H 'Content-Type:application/json; charset=utf-8' -H 'Authorization:QB-USER-TOKEN  token_here' -H 'QB-Realm-Hostname:hostname_here'

note that in Authorization header, we have double space between QB-USER-TOKEN and token_here, seems like postman trim the string, and create the auth header without the double space.

but what is the problem?

Postman is a testing/debugging tool, if it does not reflect what I am debugging it makes waste time when fixing such a simple and small issue, as a debugging tool I expect it to reflect exactly the api call I am making in my application so I can compare the difference.

Steps To Reproduce

  1. import this cURL

    curl -X GET "https://api.quickbase.com/v1/apps/some_id_here" -H 'Accept:application/json, text/plain, */*' -H 'Content-Type:application/json; charset=utf-8' -H 'Authorization:QB-USER-TOKEN  token_here' -H 'QB-Realm-Hostname:hostname_here'
  2. note it will not 100% reflect this cURL when importing, it will remove the double space between QB-USER-TOKEN and token_here

Screenshots or Videos

No response

Operating System

macOS

Postman Version

10.24.26

Postman Platform

Postman App

User Account Type

Signed Out User

Additional Context?

No response

DannyDainton commented 1 month ago

Hey @leognmotta,

In the latest major version of Postman, I'm not seeing that issue when pasting your cURL request into the address bar:

https://github.com/user-attachments/assets/8a39ec66-7a6d-427c-b51e-9168bcaa39cf

leognmotta commented 1 month ago

Hey @leognmotta,

In the latest major version of Postman, I'm not seeing that issue when pasting your cURL request into the address bar:

20241017145104958.mp4

something weird is happening, I pasted the censored snippet I gave, and indeed worked as expected, but I pasted the original curl with a token, and it removed the double spaces

leognmotta commented 1 month ago

it could be version related, let me double check, and I will update here

leognmotta commented 1 month ago

@DannyDainton I tested this with my colleague, and we weren’t able to consistently reproduce the issue. I’ll be closing this for now, but if I encounter something similar in the future, I’ll provide an update.