This article explains the need to encode special characters when a URL is used as part of a command-line to ensure proper functionality.
The list of special characters and their corresponding encoding characters are listed below:
Example of Usage:
When fetching a file to the router from local server:
Special character “+” need to be encoded in URL so it need to be replaced by %2B.
user@host> request system software add no-copy no-validate ftp://uname:abcdefg+@ <server-ip> /jinstall-x-signed.tgz
NOTE: Since "@" is a part of the syntax format for accessing URL, there is no need to encode this character when it is used in "username:password @ server_ip" format. If "@" is being used elsewhere in the username/password, one must encode this character too. In that case, @ will be encoded as %40
Here, the username is uname and password is "abcdefg+"
When the above command is executed, you will see the followoing error message:
fetch: ftp://uname:*@ <server-ip> /jinstall-x-signed.tgz : Not logged in ERROR: Cannot fetch file: jinstall-x-signed.tgz Removing temporary file '/var/tmp/incoming-package.tgz'
Correct Usage:
user@host> request system software add no-copy no-validate ftp://uname:abcdefg %2B @ <server-ip> /jinstall-x-signed.tgz
Here, abcdefg+ is represented as abcdefg%2B where %2B is the encoded format of "+".