Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

POSTing binary data

 
David Mace
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing an applet which will perform a basic POST for me. I have all of the drag and drop functionality sorted out and everything else for the GUI, but I'm a bit stuck on the actual POST operation.

I found a good article discussing POSTing of text data on javaworld.com, but I haven't been able to track down anything discussing transmitting binary data via POST. Any help or a pointer in the right direction?

Thanks,
David
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Posting binary data is not really different from posting text data. If you're using [Http]URLConnection you're working with a stream anyway. This example shows how to post to a servlet. Of course, you don't have to send a serialized object - you can send any binary data you want.
 
David Mace
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You know, I searched a few search engines for a couple hours and couldn't find an example like this. Thanks for the link!

David
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!