Results 1 to 7 of 7
  1. #1
    Nicole is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default HttpClient invalid headers

    Ok, here's the deal... I'm trying to open a page using Apache HttpClient, but it's throwing an exception:

    Java Code:
    Caused by: org.apache.http.ProtocolException: Invalid header: Content-Length 932
    I can open the page just fine using URLConnection, but HttpClient can't parse the headers.

    Any ideas on how to suppress it / get around it?

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    There's supposed to be a colon after Content-Length isn't there?

  3. #3
    Nicole is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default

    Yep, there should be.

  4. #4
    Nicole is offline Member
    Join Date
    Mar 2009
    Posts
    5
    Rep Power
    0

    Default

    It was a simple request so I was able to replace it with URLConnection, but for some even URLConnection doesn't always fire.

  5. #5
    vogash is offline Member
    Join Date
    Mar 2009
    Posts
    10
    Rep Power
    0

    Default

    for me its also doesn't fire

  6. #6
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    If the site does not conform to HTTP, and you are required to support that nonconforming site, then you must connect with plain old sockets and write your own interface.

  7. #7
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    In the meantime I would complain at whoever is running the broken server

Similar Threads

  1. Scrolling and Headers in a scroll pane
    By glhansen in forum AWT / Swing
    Replies: 10
    Last Post: 04-03-2009, 02:06 AM
  2. Getting httpclient working with eclipse.
    By int80 in forum Eclipse
    Replies: 4
    Last Post: 03-31-2009, 01:17 PM
  3. Replies: 1
    Last Post: 03-13-2009, 09:10 PM
  4. tooltips for JTable column headers
    By fossildoc in forum AWT / Swing
    Replies: 2
    Last Post: 12-18-2008, 11:42 AM
  5. Invalid Argument error in IE7
    By Kaviurs in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-01-2008, 09:12 AM

Posting Permissions

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