代码
Squall_Zhong
这个作者很懒,什么都没留下…
展开
-
HTTP:HTTP GET
......conn.setRequestMethod(HttpConnection.GET);conn.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0" );conn.setRequestProperty("Content-Language", "en-US" );.....原创 2004-09-20 12:38:00 · 1080 阅读 · 0 评论 -
HTTP:HTTP GET Images
......DataInputStream iStrm = conn.openDataInputStream();byte imageData[];//如果已知图片尺寸 if (length != -1) { imageData = new byte[length]; // 读取图片数据至imageData数组 iStrm.readFully(imageData);/原创 2004-09-20 12:44:00 · 1159 阅读 · 0 评论 -
HTTP:HTTP POST
1.通过POST方法,发送数据至HTTP Server2.大家通常忽略Content-Type和Content-Length......conn.setRequestMethod(HttpConnection.POST); conn.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0" ); conn原创 2004-09-20 12:26:00 · 1231 阅读 · 0 评论 -
Server-Side:MimeType
在Apache配置文件中加入以下: AddType text/vnd.sun.j2me.app-descriptor .jad AddType application/java-archive .jar原创 2004-09-20 12:13:00 · 844 阅读 · 0 评论 -
J2ME Read Cookies
private String readCookie( HttpConnection conn ) throws IOException { String key; String value; String[] substrs; for( int i = 0; ( key = conn.getHeaderFieldKey( i ) ) != null; ++i ) {原创 2004-10-25 17:08:00 · 984 阅读 · 0 评论