I have C++ HTTP code on the client side which will communicate with a remote web service on the server side.
The server is Tomcat Apache server which is configured on port 8080.
The webservice which I have to access through my C++ http code is at:
http://somehostname:8080/some_path/some_api
Is this possible?
1st confusion: I know that HTTP POST requests are sent on port 80 and here I have port 8080.
2nd confusion: The server is Tomcat Apache and the server code(webservice) is in java. This means that I have to access that java code through my C++ HTTP POST method. Is it possible to communicate C++ HTTP POST method to JAVA?
An application can use any available/free port. By convention certain ports are used by specific applications. E.g. usually HTTP servers run on port 80 but they can also run on 8080 or any other port.
Yes it is possible.
You are essentially sending an HTTP message that the receiving side i.e. the Java application can “understand” it since it will be formed according to the HTTP standard (an HTTP message has a specific format).
All in all an HTTP message is plain text.
You should note though that in general there are many pitfalls when you try to communicate a C++ application with a Java application as there are subtle differences e.g. Java’s lack of unsigned primitives compared to C++ etc