Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var request = require('request');
  2.  
  3. var myJSONObject = {
  4.     "key": {
  5.       "consultores.username": "2",
  6.       "consultores.password": "2"
  7.     }
  8. };
  9. request({
  10.     url: "http://364ee9b9.ngrok.io/imobiliarias/find",
  11.     method: "POST",
  12.     json: true,   // <--Very important!!!
  13.     body: myJSONObject
  14. }, function (err, res, body) {
  15.     if (res.statusCode === 200) {
  16.       for (i = 0; i < body[0].consultores.length; i++) {
  17.         if (body[0].consultores[i].username === "2" &&
  18.          body[0].consultores[i].password === "2") {
  19.           console.log(body[0].consultores[i]);
  20.         }
  21.       }
  22.     }
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement