2 Replies Latest reply on Jun 27, 2017 4:08 AM by kavs

    Bluemix cloud- http request

    kaviyaa

      Hi,

      Iam new to IBM bluemix cloud...I want to send data from WIFI module to cloud foundry apps in bluemix cloud via HTTP_POST method.. In cloud foundry app python server program will be running.. I referred httpbin_org.c program.. I have modified server name and uri to url of the app and changed the request format to

                   wiced_JSON_parser_register_callback(parse_http_response_info);

                   header[0].field        = HTTP_HEADER_HOST;

                   header[0].field_length = sizeof( HTTP_HEADER_HOST ) - 1;

                   header[0].value        = SERVER_NAME;

                   header[0].value_length = sizeof( SERVER_NAME ) - 1;

                   header[1].field        = HTTP_CONNECTION;

                   header[1].field_length = sizeof( HTTP_CONNECTION ) - 1;

                   header[1].value        = keepalive;

                   header[1].value_length = sizeof( keepalive ) - 1 ;

                   header[2].field        = HTTP_HEADER_CONTENT_TYPE;

                   header[2].field_length = sizeof( HTTP_HEADER_CONTENT_TYPE ) - 1;

                   header[2].value        = CONTENT_TYPE;

                   header[2].value_length = sizeof( CONTENT_TYPE ) - 1;

                   snprintf(content_length_buffer,content_length_buffer_size,"%d",sizeof(MESSAGE)-1);

                   header[3].field        = HTTP_HEADER_CONTENT_LENGTH;

                   header[3].field_length = sizeof( HTTP_HEADER_CONTENT_LENGTH ) - 1;

                   header[3].value        = content_length_buffer;

                   header[3].value_length = strlen( content_length_buffer );

                   header[4].field        = HTTP_CLRF;

                   header[4].field_length = sizeof( HTTP_CLRF ) - 1;

                   header[4].value        = MESSAGE;

                   header[4].value_length = sizeof( MESSAGE ) - 1;

                   http_request_init( &requests[0], &client, HTTP_POST, request_uris[0], HTTP_1_1 );

                   http_request_write_header( &requests[0], &header[0], 5 );

                   http_request_write_end_header( &requests[0] );

                   http_request_flush( &requests[0] );

      But from the event_handler iam not getting any response from the server.. Why Iam not able to connect the cloud foundry app..Is there anything I have to change in the server name ,uri or in request format... please help me to solve this issue..Iam stuck up with this for so long time... please help me...Waiting for the reply..

      Thank you...