Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
调用服务的实际客户端位于内部属性“REMOTE_ADDRESS”中。但是我们无法从芭蕾舞演员 http:Request 中检索到它。有没有办法我们可以从芭蕾舞演员的 http 请求中获取客户端的远程 IP
芭蕾舞女演员版本 0.97.1
您无法从 http 请求中检索 IP 地址。Ballerina 在端点中有远程主机/端口来构造地址。请检查以下代码片段。
@http:ResourceConfig { path:"/local", methods:["GET"] } sample (endpoint caller, http:Request req) { string remoteHost = caller.remote.host; int remotePort = caller.remote.port; }