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
This week's book giveaway is in the
Design and Architecture
forum.
We're giving away four copies of
Communication Patterns: A Guide for Developers and Architects
and have Jacqui Read on-line!
See
this thread
for details.
Win a copy of
Communication Patterns: A Guide for Developers and Architects
this week in the
Design and Architecture
forum!
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
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Beginning Java
post request to url
dale conn
Ranch Hand
Posts: 57
posted 18 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 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
no worries sorted it
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
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...