Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    SOLVED

    HTTPRestClient_Post : unable to resolve hostname error=167976961

    Member

    HTTPRestClient_Post : unable to resolve hostname error=167976961

    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 ?

    2 REPLIES 2
    Occasional Contributor

    Re: HTTPRestClient_Post : unable to resolve hostname error=167976961

    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.

     

    Member

    Re: HTTPRestClient_Post : unable to resolve hostname error=167976961

    I found that problem was related with wifi connection. I put wifi to hibernate mode to wifi then I change mode to wakeup when I need to use. I realized wakeup was not working correctly. Thank you for trying to help 🙂

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist