我正在尝试创建一个记录到服务器的方法,获取它找到的 json 文件,然后选择每个元素中的 4 个并将其发送到一个地址。当我只为发送链接中的每种格式提供一个已知的单个数据而不是一次应该选择每个格式的循环时,我的下面的代码似乎可以工作。我得到的错误是:instance of smallInteger did not understand #readStream
。是什么导致了这个错误?我还能如何自动化这些请求?
1 to: 4 do: [ :each |
each.
a := ZnClient new.
a get: 'https://MyServer/'.
a headerAt: 'referer' put: 'https://MyServer' ;
formAt: 'email' add: 'myEmail' ;
formAt: 'password' add: 'MyPass'.
a post.
a get: 'https://MyServer/json'.
data := NeoJSONReader fromString: a contents.
list := data at: each.
foo := list at: 'num'.
poo := list at: 'name'.
a get: 'https://MyServer/copy/', poo.
a url: 'https://MyServer/send/'.
a formAt: 'add' add: 'given address' ;
formAt: 'nb_pic' add: foo ;
formAt: 'identf' add: poo.
a post.
a get: 'https://MyServer/json' ]