Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6920207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:07:06+00:00 2026-05-27T10:07:06+00:00

I have not worked with HTTP post/get before, my up coming project in my

  • 0

I have not worked with HTTP post/get before, my up coming project in my office is based on http post/get in java. Its basically client – server based application. the client will post some info and I need to get that info and process the string and vice-verse. this project has to be developed on J2SE. You can assume this some thing like a JMS queue message processing stuff. I googled for the info but most of the information was for web application, mine should work like a message queue. Can someone explain me how to do this or point me where I can get some useful info.

Thanks
Arun

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:07:06+00:00Added an answer on May 27, 2026 at 10:07 am

    Well, if you don’t need to specifically use strict HTTP, and you need to just use Java SE (and not Java EE, which rules out Servlets, JSPs, JMS, etc), then you need to probably investigate ServerSocket and Socket classes.

    Server

    Your server would need to listen on a TCP port (say, port 8080) – usually you would pick a port number between 1025 and 65,535, however if you are attempting to use an already defined service that has a default port, then use that. Note however, that on unix, in order to listen on any port below 1024, I believe you need to be root. Traditionally, port 80 is used for HTTP.

    To listen on this port, you would need something like this in your code:

    ServerSocket srvSocket = new ServerSocket(8080);
    Socket socket = srvSocket.accept();
    

    This pretty much the most basic code that would cause your application to wait until something connected to port 8080. Once connected, you could obtain both an InputStream and OutputStream for your connected client, by interrogating the returned socket object, allowing you to read content from the client, and inserting these requests in a queue. This queue could be then processed by some other Thread.

    Client

    In order for your client to connect to the server, you would need to use something based on the following example:

    Socket connection = new Socket("server.domain.com", 8080);
    OutputStream output = connection.getOutputStream();
    

    You would then write your request to the server into the OutputStream (and read from the InputStream returned from getInputStream() if you expected a response)

    The code supplied is pretty basic, but it should give you a rough idea of how to proceed. You can even use this method if you wanted to use real HTTP, however it might be a better idea to use some premade library if that was the case (although its probable that you’re not going to require all functionality defined in the HTTP spec itself).

    Anyway, I hope that provides you a good starting point from which to build.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I believe several of us have already worked on a project where not only
I have not worked with web programming or web forms before so I am
I have not worked with parameters in ADO.Net very much. I'm writing a custom
I'm ashamed to say it, but I have to. I have not worked with
So I've never worked with stored procedures and have not a whole lot of
I have worked on iPhone application but not aware of the formalities to submit
what worked fine is http://kdl.nobugware.com/post/2009/02/17/virtualbox-nat-ssh-guest/ so that i can connect to guest system using
I have control over the HttpServer but not over the ApplicationServer or the Java
I have this image proxy. It worked fine in PHP 4 but not that
EDIT/UPDATE: 1) I tried the URL with just http (not https), and it worked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.