Space 在 URL 参数中

Space in URL parameter

如何给 space(我在 url 中用下划线标记 space)作为 URL参数?像这样:

127.0.0.1:9000/test?param1=AfterThisThereIsSpace_¶m2=HereNot

感谢和欢呼。

您需要使用转义的十六进制等效项对这些空白 space 进行编码,在您的情况下,

 127.0.0.1:9000/test?param1=AfterThisThereIsSpace%20&param2=HereNot

这里空白space相当于“%20”