http encoding question

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
rsegoly
Posts: 46
Joined: 14 Jun 2013 15:30

http encoding question

Post by rsegoly » 12 Dec 2014 06:22

I need to send this value on http request
http://yozmaportal.net/put_in_cell.php? ... lue=python on.py
But I get an error of illegal character in query.
Do I need to encode somehow?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: http encoding question

Post by Martin » 12 Dec 2014 16:42

Hi,

Do you mean the space between python and on.py? Spaces in the query part of the URL should be escaped using +:
http://yozmaportal.net/put_in_cell.php? ... thon+on.py

You can also use functions encodeURL(variable_name) or encodeURLForm(variable_name) when the value is coming from a variable.
encodeURLForm can be used when the you are adding a parameter to the query part of the request (after ?) other parts of the url should usually be escaped using encodeURL.

Regards,
Martin

Post Reply