Answer the question
In order to leave comments, you need to log in
How can I access a server in Java from a program?
Hello!
I have a desktop application written in java. I need to register a program by key, and I want to do it in the form of a call to the server. That is, the user enters a key that is sent to the server, where it is checked, recorded and returns a confirmation of registration.
I do not know how to actually organize such a client-server, and what is needed for this. If I understand correctly, I need to send http requests from the client, and the server must catch them. For example, my server code is now running on localhost, but how can I make it available to everyone from the Internet?
Answer the question
In order to leave comments, you need to log in
Your question is too general, you would break it into some stages, so it will be easier for you to solve the problem.
As far as I understand, your task consists of the following subtasks:
1) Setting up (purchasing) the server
2) Writing the server part
3) Connecting from Java to the server via http(c).
4) Sending data to the server
5) Processing the server response
In step 3, it is most likely to use CURL, the rest of the tasks must be based on too many factors to give any unambiguous answer. Here you are already looking for solutions specifically for the situation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question