【发布时间】:2010-12-23 04:20:59
【问题描述】:
我正在创建一个 HTTPS 连接并将请求属性设置为 GET:
_httpsConnection = (HttpsConnection) Connector.open(URL, Connector.READ_WRITE);
_httpsConnection.setRequestMethod(HttpsConnection.GET);
但是如何发送 GET 参数呢? 我是否像这样设置请求属性:
_httpsConnection.setRequestProperty("method", "session.getToken");
_httpsConnection.setRequestProperty("developerKey", "value");
_httpsConnection.setRequestProperty("clientID", "value");
还是我必须写入连接的输出流?
或者我是否需要通过将参数/值附加到 url 来发送它?
【问题讨论】:
-
我不是黑莓开发者。但是您可以使用网络嗅探器(IMO overkill)或简单的服务器端脚本轻松测试您的代码,这些脚本只会输出您的请求信息。例如在 php 中你可以使用:php.net/manual/en/reserved.variables.request.php
标签: http blackberry https get