Skip to content

Quote URL for curl api commands containing &

Greg Myers requested to merge api-curl-quote-url-docs into master

What does this MR do?

Encapsulates URLs in quotes for api curl commands if they contain an &

If using multiple parameters are linked with ampersand (&) character in a URL, bash fails to recognize anything after the &

Example:

The following commands should return 50 results:

curl -H "Private-Token: ***" https://example.com/api/v4/users?active=true&per_page=50
curl -H "Private-Token: ***" https://example.com/api/v4/users?active=true&page=2per_page=50

However, these commands return the same 20 results (essentially ignoring everything after the &)

Encapsulating the URL in quotes returns the expected results.

Fixes #63904 (moved)

Does this MR meet the acceptance criteria?

Conformity

Merge request reports