What is the recommendation when passing query parameter which has special character (+)

Hi, :grinning_face:

I am using postman to test one the API functionality (below is the sample example for demonstration):
http://localhost:8080/items?id=ID12345&name=Test + User

I am using golang, when I receive this request I see the β€œ+” sign replaced with space, see below:

2025/04/01 14:19:50 Raw Query: id=ID12345&name=Test%20+%20User
2025/04/01 14:19:50 idQuery: ID12345
2025/04/01 14:19:50 nameQuery: Test User

Post research I found:

  • To handle this correctly, you need to replace the + character with %2B in the query string before sending the request.

Is it recommended or any other way to address this?

  • Do manual decoding on the raw data, but it will be error prone.

Can you suggest the better way to handle this?

Hey @skuindian :waving_hand:

Welcome to the Postman Community! :postman:

You’re right Test%2bUser would give you Test+User - The spaces are being added because there are spaces there.

Can you provide more context about how or why the + is being used there in your query string?

Thanks @danny-dainton

This is the context of the API:
I have an application which reads the application information from the user. The application structure contains:
app_id
app_name
app_version

The app_version follows the semver standard (https://semver.org/)

<valid semver> ::= <version core>
                 | <version core> "-" <pre-release>
                 | <version core> "+" <build>
                 | <version core> "-" <pre-release> "+" <build>

Application receives this input from the user and perform version comparison of the different applications and version.

In my UI client I am encoding the query for + to avoid any error but API is also exposed to end user for the API usecases. Initially I thought to ask user to encode the + before providing the version input but it may be inconvenient for the user & also need documentation in API spec.