如何将由空格参数分隔的字符串传递给Jenkins构建触发器? [英] How pass string separated by spaces parameter to Jenkins build trigger?
本文介绍了如何将由空格参数分隔的字符串传递给Jenkins构建触发器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前为止有效:
http://JENKINS_SERVER/job/YOUR_JOB_NAME/buildWithParameters?myparam=Hello
但是,当myparam
的值包含类似于Hello word
的空格时,它将不起作用:
But when the value of myparam
contains whitespaces like in Hello word
it doesn't work:
myparam=Hello word
整行:
http://JENKINS_SERVER/job/YOUR_JOB_NAME/buildWithParameters?myparam=Hello world
如何传递此参数值?
推荐答案
您只需要用%20替换空格:
You just need to replace the blank space by %20 :
http://JENKINS_SERVER/job/YOUR_JOB_NAM/buildWithParameters?myparam=Hello%20world
这被称为 URL编码,用于不安全或特殊字符.
This is known as Url Enconding used for unsafe or special characters.
这是摘要表:
character encoded equivalence
backspace %08
tab %09
space %20
! %21
" %22
# %23
$ %24
% %25
& %26
' %27
( %28
) %29
* %2A
+ %2B
, %2C
- %2D
. %2E
/ %2F
: %3A
; %3B
< %3C
= %3D
> %3E
? %3F
@ %40
[ %5B
\ %5C
] %5D
^ %5E
_ %5F
` %60
{ %7B
| %7C
} %7D
¿ %BF
参考文献:
- https://blogs.msdn.microsoft.com/oldnewthing/20100331-00/?p = 14443
- https://perishablepress.com/stop-using-unsafe-网址中的字符/
- 完整的url编码值: https://www.degraeve.com/reference/urlencoding. php
- https://blogs.msdn.microsoft.com/oldnewthing/20100331-00/?p=14443
- https://perishablepress.com/stop-using-unsafe-characters-in-urls/
- complete url encoded values : https://www.degraeve.com/reference/urlencoding.php
这篇关于如何将由空格参数分隔的字符串传递给Jenkins构建触发器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文