Skip to main content
Apr 22, 2013 1:28 PM UTC
Question

receive data problem from HTTP

whould you help me in this regards.

Successfully sent data in server but data which i sent from server that could not receive in client side.

in debug mode

bytesSent = 21

bytesReceived = 21

response =

responseStstus=-1

but i'm not able to extract the data.

    var that = this;   

    var http = new HttpConnection(that.httpAddress) ;

    $.writeln("AsyncHTTP: create connection...");   

     http.requestencoding="utf8";

    http.request = "yourname=Mahedi Hasan" ;

    http.method = "POST";

    http.async = true ; // or http.sync = false ;

    http.responseencoding ="utf8";

    http.bytesSent;

    http.bytesReceived;

    http.response;

   var status = http.execute() ; // returns immediately

php code:

     $value = file_get_contents("php://input");

    $file = 'people.txt';

    file_put_contents($file, $value); //write data which i sent from client side

    echo $value;

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Inspiring
Apr 22, 2013 2:16 PM UTC

Don't you need to use the socket object…? See the guide…

Translate
Apr 22, 2013 2:39 PM UTC

would you please elaborate

which potion, which page and if possible with snapshot or example.

thanks

Translate
Inspiring
Apr 22, 2013 3:00 PM UTC

Well cut and paste from the guide…

reply = "";

conn = new Socket;

// access Adobe’s home page

if (conn.open ("www.adobe.com:80")) {

// send a HTTP GET request

conn.write ("GET /index.html HTTP/1.0\n\n");

// and read the server’s reply

reply = conn.read(999999);

conn.close();

}

Translate