CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Pakistan
    Posts
    207

    URLConnection not working

    Please see the following code & help me :

    URL hp = new URL ("http://www.starwave.com/people/naughton/");
    URLConnection hpCon = hp.openConnection ( );
    int len = hpCon.getContentlength ( );
    if (len > 0) {
    System.out.println("Content-length: + len);
    }
    else {
    System.out.print("No Content Available");
    }

    I am getting
    "No Content Available"

    Can somebody tell me what is the reason for this message ??

    Zulfi.


  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: URLConnection not working

    There may be one of the two reasons...

    1. the url u r trying is redirecting
    2. The server may be sending data in chunks. I don't know if the URLConnection class retrieves contents if sent in chunks.

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured