C++ 无法使用Poco获取字符串的路径

C++ 无法使用Poco获取字符串的路径,c++,poco-libraries,C++,Poco Libraries,我试图将路径放入字符串中,但它始终为空: Poco::URI uri("http://10.10.10.10:3535"); std::string path(uri.getPathAndQuery()); 此字符串部分从不接收任何内容,并保持为空。。 代码片段取自URI中的一个示例,路径和查询为空,因此看到空字符串是正确的。您的URI只有一个方案、主机和端口 以下是Wikipedia的URI格式图: authority pa

我试图将路径放入字符串中,但它始终为空:

Poco::URI uri("http://10.10.10.10:3535");
std::string path(uri.getPathAndQuery());
此字符串部分从不接收任何内容,并保持为空。。
代码片段取自URI中的一个示例,路径和查询为空,因此看到空字符串是正确的。您的URI只有一个方案、主机和端口

以下是Wikipedia的URI格式图:

                    authority               path
        ┌───────────────┴───────────────┐┌───┴────┐
  abc://username:password@example.com:123/path/data?key=value#fragid1
  └┬┘   └───────┬───────┘ └────┬────┘ └┬┘           └───┬───┘ └──┬──┘
scheme  user information     host     port            query   fragment

在URI中,路径和查询是空的,因此正确的做法是看到一个空字符串。您的URI只有一个方案、主机和端口

以下是Wikipedia的URI格式图:

                    authority               path
        ┌───────────────┴───────────────┐┌───┴────┐
  abc://username:password@example.com:123/path/data?key=value#fragid1
  └┬┘   └───────┬───────┘ └────┬────┘ └┬┘           └───┬───┘ └──┬──┘
scheme  user information     host     port            query   fragment

http://10.10.10.10:3535
字符串中没有任何路径或查询,因此该字符串为空。 以下是您可以单独使用的URI:

scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
eg. http:://192.168.11.2:3000/user?action=edit#basic

http://10.10.10.10:3535
字符串中没有任何路径或查询,因此该字符串为空。 以下是您可以单独使用的URI:

scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
eg. http:://192.168.11.2:3000/user?action=edit#basic

当URI为
http://10.10.10.10:3535/path/page.html?q=query
?当URI为
http://10.10.10.10:3535/path/page.html?q=query