Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.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
Php 葫芦安卓-未定义的方法`键';对于nil:NilClass(nomethoderor)_Php_Android_Ruby On Rails_Calabash - Fatal编程技术网

Php 葫芦安卓-未定义的方法`键';对于nil:NilClass(nomethoderor)

Php 葫芦安卓-未定义的方法`键';对于nil:NilClass(nomethoderor),php,android,ruby-on-rails,calabash,Php,Android,Ruby On Rails,Calabash,我需要你的帮助来解决我面临的错误 我正在使用葫芦为我的应用程序创建测试,下面是我的代码: url = 'myUrl' http = Net::HTTP.new(url, 80) path = '/login/login.php' resp, data = http.get(path, nil) <-- This line fires the error cookie = resp.response['set-cookie'] 我不明白它指的是什么?我怎样才能解决它?知道第33行是

我需要你的帮助来解决我面临的错误

我正在使用葫芦为我的应用程序创建测试,下面是我的代码:

url = 'myUrl'
http = Net::HTTP.new(url, 80)

path = '/login/login.php'

resp, data = http.get(path, nil)   <-- This line fires the error
cookie = resp.response['set-cookie']
我不明白它指的是什么?我怎样才能解决它?知道第33行是我在第一个代码段中显示的那一行

我想我是在调用一些未定义的变量或空变量的键,但不知道是哪个,这是一个简单的代码


我欢迎任何想法!谢谢=)

只需删除
nil
参数:

resp, data = http.get(path)

你好,凯文,请你编辑你的问题,删除或翻译法语部分?StackOverflow是一个“纯英语”的网站。你说得对,我把太多精力放在了我刚才说的话上,谢谢你的提问。我试过了,现在发现了这个错误:getaddrinfo:unknown host。(SocketError)您在
url
变量中指定的服务器名称不正确。好的,我今天会尝试找出答案,稍后我会回来确认您的答案!谢谢
resp, data = http.get(path)