Here we will use “java.net.URL” and “java.net.HttpURLConnection” to create a simple Java client to send “GET” and “POST” request.
NOTE: Same way, by using "POST" method we can create Java Client using java.net.URL with few changes in the above code.
GET Request
REST service that return “json” data back to client.Java client to send a “GET” request:
Output:Output from Server ....
{"qty":999,"name":"iPad 3"}
NOTE: Same way, by using "POST" method we can create Java Client using java.net.URL with few changes in the above code.
Hello, Iᡉm Dhananjaya Naidu Reddi, a passionate Java Developer based in the vibrant city of Bangalore, India. Like many of you visiting, I have a deep appreciation for Java and the art of software development. I have extensive experience as a Java/J2EE Full Stack developer, proficient in a wide range of technology frameworks and cloud technologies.
0 comments:
Post a Comment