Referencing spaces in names using XML API

L3 Networker

Referencing spaces in names using XML API

The only thing he hasn't been able to resolve now is if the URL to block contains certain characters, like &, he gets a malformed request error. Any idea how to get around this. I tried \ before it as well as using an encoding value like %26 in place of it. If it helps, below is an example of a url that is not working. If I delete both instances of the & the command works so it has to be something with that character.


curl -k "https://kermit.umbc.edu/api/?type=config&action=set&key=<key>=&xpath=/config/shared/profiles/custom-...\[@name='SES'\]/list&element=<member>fabiogoleirooficconfirmphpcmd=login_submit&id=afcfa822c51dd78f62a028b4f8859c92afcfa822c51dd78f62a028b4f8859c92&sessionaf</member>"

response status="error" code="18"><msg><line>Malformed Request</line></msg></response

 

Would the solution be the same as another one for passwords?

 

https://live.paloaltonetworks.com/t5/Management-Articles/XML-API-Issue-with-passwords-containing-spe...

 

Solution

A possible workaround is to URL-encode the # symbol (%23) as defined in the same RFC3986 or to avoid using # special character in the password.

 

Please let me know.


Chris.

L0 Member

Re: Referencing spaces in names using XML API

I have found when using cURL, %20 works for space chars, for example:

 

curl -X GET 'https://firewall/api/?type=keygen&user=myuser&password=my%20password'

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!