SORU
13 NİSAN 2011, ÇARŞAMBA


Ne kadar uzak DİNLENME node.js içinde arama yapmak için? herhangi bir CURL?

Node.jsçocuk işlem yapmak için kullanmaktan başkaCURLarama, CURL uzak sunucu için arama yapmak için bir yoldurDİNLENMEVe dönüş veri API mı?

Ben de istek uzaktan bağlantı kurmak gerekirDİNLENMEve sorgu dize gel de (veya SONRASI).

Bu bir tane buldum: http://blog.nodejitsu.com/jsdom-jquery-in-5-lines-on-nodejs

ama sorgu dizesi göndermek için herhangi bir yol göstermiyor.

CEVAP
13 NİSAN 2011, ÇARŞAMBA


http.request bak

var options = {
  host: url,
  port: 80,
  path: '/resource?id=foo&bar=baz',
  method: 'POST'
};

http.request(options, function(res) {
  console.log('STATUS: '   res.statusCode);
  console.log('HEADERS: '   JSON.stringify(res.headers));
  res.setEncoding('utf8');
  res.on('data', function (chunk) {
    console.log('BODY: '   chunk);
  });
}).end();

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Kiddyzuzaa

    Kiddyzuzaa

    25 ŞUBAT 2014
  • Krumme1996

    Krumme1996

    21 EYLÜL 2009
  • The Dubstep FX

    The Dubstep

    5 Mart 2011