P4 REST API: Reserved characters

If a filename contains P4 Server reserved characters such as @, #, *, or %, escape those characters using P4 file-spec escaping before sending the value in a REST API request. Because REST API requests are also URL-encoded by the HTTP layer, escaped values may need to be URL-encoded again when passed as query parameters.

For example, a literal * in a filename must first be escaped for P4 Server as %2A. When sent through an HTTP query parameter to the P4 REST API, the percent sign is URL-encoded, producing %252A. After the P4 Web Server decodes the HTTP request, the P4 REST API forwards the request to the P4 Server as %2A.

If you use an HTTP client library that automatically URL-encodes query parameters, escape P4 reserved characters in the filename before passing the fileSpec value to the client library.