REST API skips "+" character

> When I add a host to foreman via the REST API "+" characters are skipped.
> I work with curl, the following lines give the problem:
>
>
> echo ${SUDOER}
> {"LEGACY_DBA_SHELLS":{"user":"+DBA"
> ,"host":"ALL","runas":"oracle","cmnd":"DBA_SHELLS","cmnd_alias":["/bin/sh","/bin/bash","/bin/csh","/bin/ksh","/usr/bin/ksh","/usr/bin/pdksh"],"options":["NOPASSWD"]}
> *
>
> curl …
>
> -d "host[host_parameters_attributes][4[name]]=legacy_sudoers"
> -d "host[host_parameters_attributes][4[value]]=${SUDOER}
> -d "host[host_parameters_attributes][4[nested]]=true"
>
> these lines result in parameter legacy_sudoers with the value
> {"LEGACY_DBA_SHELLS":{"user":" DBA"
> ,"host":"ALL","runas":"oracle","cmnd":"DBA_SHELLS","cmnd_alias":["/bin/sh","/bin/bash","/bin/csh","/bin/ksh","/usr/bin/ksh","/usr/bin/pdksh"],"options":["NOPASSWD"]}
> *
> the "
+
" changed to " "…

You should probably URL escape the query, normally + becomes %2B

··· On Mon, Feb 4, 2013 at 9:22 AM, wrote:


You received this message because you are subscribed to the Google Groups
“Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.