Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
post request to url
dale conn
Ranch Hand
Posts: 57
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi all i'm trying to post some data to a url but it's not working, i don;t get any errors, can anyone tell me where i'm, going wrong
many thanks
String data = URLEncoder.encode("name", "UTF-8") + "=" + URLEncoder.encode("myname", "UTF-8"); data += "&" + URLEncoder.encode("email", "UTF-8") + "=" + URLEncoder.encode("myemail@email.com", "UTF-8"); data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode("password", "UTF-8"); URL url = new URL("http://sub.domain.com/folder1/add"); URLConnection urlConnection = url.openConnection(); urlConnection.setDoOutput(true); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(urlConnection.getOutputStream()); outputStreamWriter.write(data); outputStreamWriter.flush(); outputStreamWriter.close();
dale conn
Ranch Hand
Posts: 57
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
no worries sorted it
There were millions of the little blood suckers. But thanks to this tiny ad, I wasn't bitten once.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Passing parameters to url using java.net package
HTTPS Post Request through the URL
Communicate with the server without a browser.
error while submitting an http web request
Sending HTML requests from java program
More...