Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何为HTTPI分配端口?_Ruby_Http_Httpi - Fatal编程技术网

Ruby 如何为HTTPI分配端口?

Ruby 如何为HTTPI分配端口?,ruby,http,httpi,Ruby,Http,Httpi,我在用图书馆 通常在http库中,我们可以为http连接设置端口,但在httpi中,我不能 如何为HTTPI连接分配端口?通常,您会在URL中包含端口号,如下所示: request = HTTPI::Request.new("http://example.com:1234/") 不幸的是,我遇到了一个错误:“ArgumentError:无效URL:localhost:17172”

我在用图书馆

通常在http库中,我们可以为http连接设置端口,但在httpi中,我不能


如何为HTTPI连接分配端口?

通常,您会在URL中包含端口号,如下所示:

request = HTTPI::Request.new("http://example.com:1234/")

不幸的是,我遇到了一个错误:“ArgumentError:无效URL:localhost:17172”