When I want to send a post message I'm getting error:
HTTPRestClient_Post : unable to resolve hostname error=167976961
I checked steps and Setup and Enable is working fine.
This is my config setup:
static HTTPRestClient_Config_T HTTPRestClientConfigInfo =
{
.IsSecure = false,
.DestinationServerUrl = DestinationServerUrl,
.DestinationServerPort = 80,
.RequestMaxDownloadSize = REQUEST_MAX_DOWNLOAD_SIZE,
}; /**< HTTP rest client configuration parameters */
destinationServerUrl is correct because I print it before sending request.
#define DEST_SERVER_HOST "aaa.bbbb.com"
WLAN connection is also successful.
HTTPRestClientPostInfo =
(HTTPRestClient_Post_T){
.Payload = newMessage,
.PayloadLength = msgSize,
.Url = destPostPath,
.RequestCustomHeader0 = postRequestHeader,
.RequestCustomHeader1 = POST_REQUEST_CUSTOM_HEADER_1,
}; /**< HTTP rest client POST parameters
Error thrown after this:
HTTPRestClient_Post(&HTTPRestClientConfigInfo, &HTTPRestClientPostInfo, APP_RESPONSE_FROM_HTTP_SERVER_POST_TIMEOUT);
What can be the reason of this error message ?
Solved! Go to Solution.
Hello hasalp
In Appcontroller.c file, Could you please update as below,
static HTTPRestClient_Config_T HTTPRestClientConfigInfo =
{
.IsSecure = false,
.DestinationServerUrl = DEST_SERVER_HOST,
.DestinationServerPort = DEST_SERVER_PORT,
.RequestMaxDownloadSize = REQUEST_MAX_DOWNLOAD_SIZE,
}; /**< HTTP rest client configuration parameters */
In AppController.h file, Could you please update as below,
#define DEST_SERVER_HOST "postman-echo.com"
#define DEST_SERVER_PORT UINT16_C(80)
I Hope this will solve the problem.