HTTP: http post

xiaoxiao2021-03-06  53

1. Send data to HTTP Server2 through the POST method. You usually ignore Content-Type and Content-Length ... conn.setRequestMethod (httpConnection.post);

Conn.setRequestProperty ("User-Agent", "Profile / MIDP-1.0 Configuration / CLDC-1.0"); Conn.setRequestProperty ("Content-Language", "EN-US");

Postmsg = Request.getbytes ();

Conn.setRequestProperty ("Content-Type", "Application / X-WWW-Form-Urlencoded"); Conn.setRequestProperty ("Content-Length", Integer.Tostring (postmsg! = null? postmsg.length: 0));

Out = conn.openoutputstream (); out.write (postmsg); ......

转载请注明原文地址:https://www.9cbs.com/read-115179.html

New Post(0)