evanpmeth (evanpmeth) wrote in myjavatools,

Sending multipart/form data

I recently stumbled upon the Sending multipart/form data ClientHttpRequest.java and was very interested. I am very new to java and still dont understand some basic concepts. I just need some clarifacation. By chance do you have example code of how to use ClientHttpRequest. I dont understand how to use:
InputStream serverInput = post(URL url, Map parameters);
I keep on getting an error that says cannot be referenced from a static context.
what do i have to do in order to have this file in a package, reference it then call the post method.
sorry if this is really simple. I just need to visually see something in cation to fully understand how it works. Also is it possible to submit a form receive a cookie from that request and re-send the cookie with a normal http request. It is for a site that uses cookies to verify a person is logged in, so in order to use what is behind the password protected area i would have re send the cookie with every request made to the server.
Thanks for your time.
  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.