Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
364
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None
  1. public void HttpPostTest() throws IOException
  2. {
  3. http=(HttpConnection)Connector.open(urlTest + CONNECTOR_EXT);//vzpostavi povezavo z serverjem
  4. System.out.println("Connector " + http.getHost());
  5. http.setRequestMethod(HttpConnection.POST);
  6. http.setRequestProperty( "X-ApiKey:", "myapikey" );
  7. oDStream=http.openDataOutputStream();
  8. oDStream.write("test,1234".getBytes(), 0 , 9); //pošlje podatke
  9. oDStream.flush();
  10. System.out.println("http: " + http.getResponseMessage() + " query " + http.getQuery() + " url " +http.getURL() + " iStream: " + iStream);
  11. processServerResponse(http,iStream);//ta metoda sprocesira odgovor, vendar je IStream null
  12. oDStream.close();
  13. }
Advertisement
RAW Paste Data Copied
Advertisement