Apache Httppost retrieve image from server Java -
Apache Httppost retrieve image from server Java -
right using httppost post parameters in form of xml server. when post occurs, geotiff or .tif file downloaded. have posted document server , downloaded file attaching parameters url can't seem combine two. have utilize post because using url leaves out elevation info in geotiff.
in short, not sure how simultaneously post , retrieve image of post. have far...
// target url string strurl = post; // file posted string strxmlfilename = xml_path; file input = new file(strxmlfilename); // prepare http post httppost post = new httppost(strurl); post.setentity(new inputstreamentity( new fileinputstream(input), input.length())); // specify content type , encoding post.setheader( "content-type", "text/xml"); // http client httpclient httpclient = new defaulthttpclient(); //locate file store info in fileentity entity = new fileentity(newtifffile, contenttype.create("image/geotiff")); post.setentity(entity); // execute request seek { system.out.println("connecting metoc site...\n"); httpresponse result = httpclient.execute(post);
i under impression entity contain resulting image. help much appreciated!
thanks help guys. entity beingness sent server. had code trying read response wasn't working because setting entity file entity messed post request. removing part, works great!
java apache http-post
Comments
Post a Comment