Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

HTTP Client Connection Header bug?


I'm using the Titanium.Network.HTTPClient to send a GET request to my RESTful Service. I noticed a few things:

  1. The HTTPClient's Request headers contains two identical headers of this type:
    "Connection: Close". I think its a bug - only a single instance of this header should exist.

  2. When trying to alter the connection from "close" to "keep-alive" :

    xhr.setRequestHeader("Connection", "keep-alive");

it's ignored.

Is this by design or is it a bug?

Further details regarding the reason I need to use a "keep-alive" connection:

My service returns an ArrayList of objects (as a JSON representation) and for some reason if the request's connection is not set to "keep-alive" the response is 200 OK with empty body.

I can confirm that this is exactly the problem because I "replayed" the request using a sniffer (while changing the connection header) and the response was fixed (I got the JSON in the body)



— asked May 2nd 2010 by Chen Bekor
  • connection
  • http
  • httpclient
  • json
  • keep-alive
  • request
  • response

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.