When URL formatting was specified in 1994, the character set was limited to a subset of available characters. To accommodate this, URL encoding was created as a way of formatting information in a Uniform Resource Identifier (URI) using specific parameters. It is used in the preparation of data of the application/x-www-form-urlencoded media type, as is often used in the submission of HTML form data in HTTP requests, such as an Encoding.com API request. Blooberry lists all the special characters that require URL encoding.
Let’s take a look at a common scenario where URL encoding is needed when using Encoding.com. FTP servers are popular source and destination locations that have specific formatting parameters. This includes the use of @ symbol to delineate the username/password and the host. The typical FTP URL looks like this:
ftp://username:password@host:port/path
When one of the reserved or unsafe characters is used in the password (for example), problems can arise when submitting the URL in an API request. If you are using the @ symbol in your password, it must be URL encoded to differentiate it from the @ already used in the path. This is where URL encoding comes in. For example, if you password is ‘Ex@mple’ it would be URL encoded as ‘Ex%40mple’ where the @ symbol is URL encoded as %40.
You should also make sure to URL encode your entire XML request using content-type: application/x-www-form-urlencoded.
*If using a signature with your AWS S3 source, the signature does not need to be URL encoded.