Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24983

Android: Add "HTTPClient.responseHeaders" support (feature parity with iOS)

    Details

      Description

      Summary:
      This is a feature parity issue between Android, iOS, and Windows Phone when using HTTPClient.

      On iOS, you access the HTTP response's headers via the "responseHeaders" property, which returns them as a dictionary...
      http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.HTTPClient-property-responseHeaders

      On Android and Windows Phone, you have to access the headers via the "allResponseHeaders" property instead, which returns all headers concatenated to a single string...
      http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Network.HTTPClient-property-allResponseHeaders

      Solution:
      Add "responseHeaders" property support to Android. The way iOS is doing it (returning a dictionary) is the superior solution. (In the future, we should add support to Windows as well.)

      Note:
      Check if iOS includes the response's "status line" in 1 of it's returned headers. This is because Android's Java HttpURLConnection.getHeaderFields() method does return the status line in the returned HashMap, which is using a null key. In my opinion, we should not return status line as a header in JavaScript (this is what our HTTPClient.statusText property is for), but we should double check our iOS implementation and follow what it does.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Joshua Quick
                Tester:
                Samir Mohammed
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration