2011-08-02 48 views
0

我正在使用Http servet實現com.sun.net.httpserver.HttpServer。在我的客戶端MIDlet中,我使用以下URL: String url =「http:// localhost:22334/name =」+ name; 當請求到達服務器時,收到的HttpExchange不包含「name = john」數據? 我如何從網址讀取數據? 謝謝, Eyal。com.sun.net.httpserver.HttpServer GET讀取數據問題

回答

1

嘗試使用

String url = "http://localhost:22334?name=" + name; 

,而不是您與斜線:http://localhost:22334/name

+0

我使用以下網址:字符串URL = 「HTTP://本地主機:22334 /名稱=」 +名字 – eyal

+0

您正嘗試使用名爲name的請求參數。是對的嗎? – gred

+0

使用String後仍然requestBody爲空url =「http:// localhost:22334?name =」+ name; – eyal