Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor grammar changes

...

If you are using the CFNetwork framework, you can use the the CFHTTPMessageSetHeaderFieldValue method method of the CFHTTPMessage class. See the code listing in Creating a CFHTTP Request in the CFNetwork Programming Guide for an example of this approach.

...

If you are using URLConnection, or any of its subclasses (HttpUrlConnectionHttpsURLConnection), you can use itsaddRequestProperty(String field, String new Value) method method to add the HTTP header. The following example demonstrates adding the x-native-id header using this method: 

...