We help IT Professionals succeed at work.

HTTP

DWR200
DWR200 asked
on
153 Views
Last Modified: 2013-11-05
in java HttpConnection.HTTP_OK means request has succeeded. but i need to convert it to c#. what is the equivalent?
Comment
Watch Question

Don't ask that in the JAVA forum .....................................................

;JOOP!
CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
i changed the rc = getResponseCode() to rc = getResponse, but got this error..
Error 1 Cannot implicitly convert type 'System.Net.WebResponse' to 'int'


int rc=0; //conn.getResponseCode();        
            try{
                rc=conn.getResponseCode();
            }catch(Exception e)
            {System.out.println(e);}
           
            System.out.println("rc have already"+conn.getResponseCode());
            if(rc==HttpConnection.HTTP_OK) {
                StringBuffer text=new StringBuffer();
                try{
                    DataInputStream din=new DataInputStream(conn.openInputStream());

                    int n=din.readInt();
                    while(n-->0) {
                        text.append(din.readUTF());
                        text.append(' ');
                    }
                }
CERTIFIED EXPERT
Top Expert 2016

Commented:
I answered the question
CERTIFIED EXPERT
Top Expert 2016

Commented:
:-)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.