| « | January 2026 | » | | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | |
| 公告 |
| 暂无公告... |
| Blog信息 |
|
blog名称: 日志总数:29 评论数量:19 留言数量:0 访问次数:118487 建立时间:2006年5月29日 |

| |
|
[java与中文]httpconnection 软件技术
krf301 发表于 2007/4/21 20:28:52 |
|
httpconnection
hc = (HttpConnection) Connector.open(url , Connector.READ/*_WRITE*/ , true ) ; if( gateway != null ){ hc.setRequestProperty( "X-Online-Host", webServerAddress ) ; } hc.setRequestProperty("Content-Type" , "application/xml, text/html, text/plain, " ) ; if(cookieSessionID!=null){ hc.setRequestProperty("Cookie", cookieSessionID); } // 告知服务器当前客户端的版本号 //hc.setRequestProperty("User-Agent", "1.0") ; 错误! hc.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1"); // CLDC-1.1 hc.setRequestProperty("Pragma", "no-cache"); hc.setRequestProperty("Cache-Control", "no-cache") ; //hc.setRequestProperty("Connection", "close"); hc.setRequestProperty("User-Chat-Agent", System.getProperty("microedition.platform") ); hc.setRequestProperty("Accept-Charset" , "utf-8" ) ; hc.setRequestProperty("Accept-Language", "zh, en" ) ; |
|
|