John Progton wrote:Basically the issues I have are in line 26 .This is the C# code
The C# code isn't relevant. What is the Java code? What is the error? What are you trying to do? How do you do it in Java? Those are the relevant questions. The fact that a line copied from C# to Java doesn't work is of no surprise.
Line 39.I used the HTTPResponse but the compiler is still complaining C# used
Diddo.
And the last is that C# has a class just called Stream but I don't know which one to use in Java for this.
What C# uses is irrelevant. The correct class to use here is... impossible to define. Request is of a type that doesn't exist, GetRequestStream() is a method that doesn't exist, so it doesn't matter what type you define dataStream to be, it will be wrong. You need to write the code in Java and use Java classes and Java methods and Java API to know what and how to call things.
If you want to use just Core Java, you should look at this API:
http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html, and read this tutorial:
http://docs.oracle.com/javase/tutorial/networking/urls/readingWriting.html. If you want to use a library that is a bit easier and more robust then take a look at Apache HttpClient.