Hi,
I am trying to create/connect httpClientHandle by doing the below in the init() of my code
Display_printf(display, 0, 0, "httpTask: CREATING HTTP"); // HTTP Construct int16_t ret = 0; int16_t statusCode; httpClientHandle = HTTPClient_create(&statusCode,0); if (statusCode < 0) { Display_printf(display, 0, 0, "httpTask: creation of http client handle failed", statusCode); } ret = HTTPClient_connect(httpClientHandle,HOST_NAME,0,0); if (ret < 0) { Display_printf(display, 0, 0, "httpTask: connect failed", ret); }
I also have a function called httpTask() which references to the above httpClientHandle by doing
extern HTTPClient_Handle httpClientHandle;
However, when I try to do a Send request inside of httpTask(), I get an error. On the other hand, when I create/connect httpClientHandle inside of httpTask() instead of init() and then do a Send request, I don't have a problem. Why is this so?
extern HTTPClient_Handle httpClientHandle;