I'm writing an API script to retrieve information about applications, and I'm having problems with applications that have spaces in their names. The usual URL encodings (+ or %20) don't work with the API. If I paste the application name into the /api web interface, it show that it's converting them to %20, but it returns no data, and I'm seeing the same results with curl.
For example, let's take Photoshop CS6.
curl --user <api_user> -X GET '<casper_url>/JSSResource/computerapplications/application/Adobe%20Photoshop%20CS6.app' # returns empty xml
curl --user <api_user> -X GET '<casper_url>/JSSResource/computerapplications/application/Adobe+Photoshop+CS6.app' # returns empty xml
curl --user <api_user> -X GET '<casper_url>/JSSResource/computerapplications/application/Adobe Photoshop CS6.app' # returns nothing
The only way I can get actual results is if I use wildcards in place of the spaces, like this:
curl --user <api_user> -X GET '<casper_url>/JSSResource/computerapplications/application/Adobe*Photoshop*CS6.app' # returns legitimate results
That's NOT an effective workaround, because it has the potential to match multiple apps, which is not what I want. For example, if someone had an app called "A 6.app", that search would match "Adobe Photoshop CS6.app" if I used wildcards. That's no good, especially since application names are arbitrary and can be changed by the end user (even accidentally).
Is the API broken? Is there a workaround? Am I the only one seeing this behavior?
Thanks.