Skip to main content
April 22, 2013
Question

receive data problem from HTTP

  • April 22, 2013
  • 5 replies
  • 919 views

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
April 22, 2013

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

April 22, 2013

would you please elaborate

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

thanks

Inspiring
April 22, 2013

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();

}