Microsoft Azure IoTHub client HTTP transport
Dependents: iothub_client_sample_http simplesample_http temp_sensor_anomaly
This library implements the HTTP transport for Microsoft Azure IoTHub client. The code is replicated from https://github.com/Azure/azure-iot-sdks
Diff: iothubtransporthttp.c
- Revision:
- 9:0b2cab6cfc60
- Parent:
- 8:1b71bf027eb5
- Child:
- 10:b012891d0a54
--- a/iothubtransporthttp.c Thu Dec 17 18:23:34 2015 -0800 +++ b/iothubtransporthttp.c Fri Jan 15 15:49:36 2016 -0800 @@ -8,6 +8,7 @@ #include "gballoc.h" #include <time.h> +#include "version.h" #include "iothub_client_private.h" #include "iothubtransporthttp.h" @@ -167,7 +168,8 @@ "Authorization":" " "Content-Type":"application/vnd.microsoft.iothub.json" "Accept":"application/json" -"Connection":"Keep-Alive"]*/ +"Connection":"Keep-Alive" +"User-Agent":"iothubclient1.0.0-preview.7]*/ static bool create_eventHTTPrequestHeaders(HTTPTRANSPORT_HANDLE_DATA* handleData, const IOTHUBTRANSPORT_CONFIG* config) { bool result; @@ -202,7 +204,8 @@ (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "iothub-to", STRING_c_str(temp)) == HTTP_HEADERS_OK) && (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "Authorization", " ") == HTTP_HEADERS_OK) && (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "Accept", "application/json") == HTTP_HEADERS_OK) && - (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "Connection", "Keep-Alive") == HTTP_HEADERS_OK) + (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "Connection", "Keep-Alive") == HTTP_HEADERS_OK) && + (HTTPHeaders_AddHeaderNameValuePair(handleData->eventHTTPrequestHeaders, "User-Agent", CLIENT_DEVICE_TYPE_PREFIX IOTHUB_SDK_VERSION) == HTTP_HEADERS_OK) )) { result = false;