Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpClient Exception: Invalid header  RSS feed

 
Jason Bock
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been able to pull the page via URLConnection, but Apache HttpClient throws an exception.
I've tried both version 3.1 and 4.0, but both of them throw the exception:



Any suggestions?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sort of looks like HttpClient is objecting to the format - shouldn't that be Content-Length: 960
?

Bill
 
Jason Bock
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:That sort of looks like HttpClient is objecting to the format - shouldn't that be Content-Length: 960
?

Bill


Right, that's what I believe to be the case as well. But there's nothing I can do about the server page, so is there a way to force HttpClient to continue processing the request in spite of the invalid header?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose you could modify AbstractMessageParser and substitute a more forgiving header parsing method, then replace the class in the HTTPClient library jar.

I believe all that code is available for your modification, but it that prospect is a little overwhelming, you might contact one of the developers. Other people may have run into this problem too.

Bill


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!