有一个问题请教各位:
A系统请求B系统的一个接口,其中有一个参数就是一个URL,例如
url = http://192.168.0.5/B/changeresponsible?responsible=ching
我在使用URI.parse的时候可以做到
[code]url = http://192.168.0.5/B/changeresponsible?responsible=ching&systemname=A
uri = URI.parse(url)
uri.host # => 192.168.0.5
uri.path # => /B/changeresponsible
uri.query # =>responsible=ching&systemname=A[/code]
有什么方法可以得到url上的get参数列表?
例如得到这样的结果:
params["responsible"]="ching"
params["systemname"]="A"
大家看看如果有看不明白的,我可以再解释更详细些。
A系统请求B系统的一个接口,其中有一个参数就是一个URL,例如
url = http://192.168.0.5/B/changeresponsible?responsible=ching
我在使用URI.parse的时候可以做到
[code]url = http://192.168.0.5/B/changeresponsible?responsible=ching&systemname=A
uri = URI.parse(url)
uri.host # => 192.168.0.5
uri.path # => /B/changeresponsible
uri.query # =>responsible=ching&systemname=A[/code]
有什么方法可以得到url上的get参数列表?
例如得到这样的结果:
params["responsible"]="ching"
params["systemname"]="A"
大家看看如果有看不明白的,我可以再解释更详细些。