Vala | 您所在的位置:网站首页 › 如何新建http › Vala |
我对vala docs有点迷惑。我正尝试使用soap lib向我的AJAX服务发出POST请求,但没有成功。有人能告诉我我哪里做错了吗? string url = "http://myservice/ajax.php"; // create an HTTP session var session = new Soup.Session (); var message = new Soup.Message ("POST", url); //Setting params and request var params = "action=call&method=get_monuments"; Soup.MemoryUse buffer = Soup.MemoryUse.STATIC; //(Error here - Line 73) message.set_request ("application/x-www-form-urlencoded", buffer, params, params.length); // send the HTTP request and wait for response session.send_message (message); stdout.write(message.response_body.data);编译器出现以下错误: /home/ibsenleo/valaprojects/test/main.vala(73,73): Error: Argument 3: Cannot convert from `string' to `uint8[]'我肯定有一些关于请求参数和数据类型的东西,但是我找不到一些有用的例子。 |
CopyRight 2018-2019 实验室设备网 版权所有 |