How to get API post request with json dataWhat's the difference between a POST and a PUT HTTP REQUEST?JavaScript post request like a form submitDetecting request type in PHP (GET, POST, PUT or DELETE)How do I get started with Node.jsHow to make HTTP POST web requestHow do I send a POST request with PHP?How to retrieve POST query parameters?How is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?The JSON data in request body is not getting parsed using body-parser

How acidic does a mixture have to be for milk to curdle?

Time travel novel: machine makes clones, clones battle to be the one to get back their life

Can the Artificer's infusions stack? Returning weapon + radiant weapon?

Does academia have a lazy work culture?

How did C64 games handle music during gameplay?

Iterate over non-const variables in C++

How do I generate distribution of positive numbers only with min, max and mean?

What does "see" in "the Holy See" mean?

How to judge a Ph.D. applicant that arrives "out of thin air"

Is dd if=/dev/urandom of=/dev/mem safe?

Why are off grid solar setups only 12, 24, 48 VDC?

Why is a dedicated QA team member necessary?

Replacing tongue and groove floorboards: but can't find a match

What does Kasparov mean by "I was behind in three and even in one after six games"?

kids pooling money for Lego League and taxes

How do we explain the E major chord in this progression?

Is my employer paying me fairly? Going from 1099 to W2

How do I address my Catering staff subordinate seen eating from a chafing dish before the customers?

What exactly makes a General Products hull nearly indestructible?

Why isn't there a serious attempt at creating a third mass-appeal party in the US?

Memory capability and powers of 2

How do professional electronic musicians/sound engineers combat listening fatigue?

How do campaign rallies gain candidates votes?

TSA asking to see cell phone



How to get API post request with json data


What's the difference between a POST and a PUT HTTP REQUEST?JavaScript post request like a form submitDetecting request type in PHP (GET, POST, PUT or DELETE)How do I get started with Node.jsHow to make HTTP POST web requestHow do I send a POST request with PHP?How to retrieve POST query parameters?How is an HTTP POST request made in node.js?How are parameters sent in an HTTP POST request?The JSON data in request body is not getting parsed using body-parser






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I'm triyng to make an API request using postman and body raw data, but I can't read the data on server side.



My request:
http://prntscr.com/n38hes



http://prntscr.com/n38hq9



I've already tried:



app.post('/test', function (req, res) 
console.log(req.query)
)


and:



app.post('/test', function (req, res) 
console.log(req.body)
)


but both of them prints



I would like to obtain the username and the password for the request I made using postman.










share|improve this question




























    1















    I'm triyng to make an API request using postman and body raw data, but I can't read the data on server side.



    My request:
    http://prntscr.com/n38hes



    http://prntscr.com/n38hq9



    I've already tried:



    app.post('/test', function (req, res) 
    console.log(req.query)
    )


    and:



    app.post('/test', function (req, res) 
    console.log(req.body)
    )


    but both of them prints



    I would like to obtain the username and the password for the request I made using postman.










    share|improve this question
























      1












      1








      1








      I'm triyng to make an API request using postman and body raw data, but I can't read the data on server side.



      My request:
      http://prntscr.com/n38hes



      http://prntscr.com/n38hq9



      I've already tried:



      app.post('/test', function (req, res) 
      console.log(req.query)
      )


      and:



      app.post('/test', function (req, res) 
      console.log(req.body)
      )


      but both of them prints



      I would like to obtain the username and the password for the request I made using postman.










      share|improve this question














      I'm triyng to make an API request using postman and body raw data, but I can't read the data on server side.



      My request:
      http://prntscr.com/n38hes



      http://prntscr.com/n38hq9



      I've already tried:



      app.post('/test', function (req, res) 
      console.log(req.query)
      )


      and:



      app.post('/test', function (req, res) 
      console.log(req.body)
      )


      but both of them prints



      I would like to obtain the username and the password for the request I made using postman.







      node.js api post request






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 16:59









      PauloPaulo

      361 silver badge6 bronze badges




      361 silver badge6 bronze badges






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Make sure you have body parser configured.



          var bodyParser = require('body-parser');

          //here app is express app
          app.use(bodyParser.urlencoded(
          extended: true
          ));
          app.use(bodyParser.json());





          share|improve this answer

























          • Still doesn't work.

            – Paulo
            Mar 26 at 17:34











          • @Paulo are you having both post methods in code?

            – Manish Kumawat
            Mar 26 at 17:39











          • what do you mean by that?

            – Paulo
            Mar 26 at 17:57











          • @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

            – Manish Kumawat
            Mar 26 at 17:59











          • I'm trying one at a time, but I tested both approaches

            – Paulo
            Mar 26 at 18:02










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55362521%2fhow-to-get-api-post-request-with-json-data%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          Make sure you have body parser configured.



          var bodyParser = require('body-parser');

          //here app is express app
          app.use(bodyParser.urlencoded(
          extended: true
          ));
          app.use(bodyParser.json());





          share|improve this answer

























          • Still doesn't work.

            – Paulo
            Mar 26 at 17:34











          • @Paulo are you having both post methods in code?

            – Manish Kumawat
            Mar 26 at 17:39











          • what do you mean by that?

            – Paulo
            Mar 26 at 17:57











          • @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

            – Manish Kumawat
            Mar 26 at 17:59











          • I'm trying one at a time, but I tested both approaches

            – Paulo
            Mar 26 at 18:02















          3














          Make sure you have body parser configured.



          var bodyParser = require('body-parser');

          //here app is express app
          app.use(bodyParser.urlencoded(
          extended: true
          ));
          app.use(bodyParser.json());





          share|improve this answer

























          • Still doesn't work.

            – Paulo
            Mar 26 at 17:34











          • @Paulo are you having both post methods in code?

            – Manish Kumawat
            Mar 26 at 17:39











          • what do you mean by that?

            – Paulo
            Mar 26 at 17:57











          • @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

            – Manish Kumawat
            Mar 26 at 17:59











          • I'm trying one at a time, but I tested both approaches

            – Paulo
            Mar 26 at 18:02













          3












          3








          3







          Make sure you have body parser configured.



          var bodyParser = require('body-parser');

          //here app is express app
          app.use(bodyParser.urlencoded(
          extended: true
          ));
          app.use(bodyParser.json());





          share|improve this answer















          Make sure you have body parser configured.



          var bodyParser = require('body-parser');

          //here app is express app
          app.use(bodyParser.urlencoded(
          extended: true
          ));
          app.use(bodyParser.json());






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 26 at 18:06

























          answered Mar 26 at 17:11









          Manish KumawatManish Kumawat

          1,0202 gold badges8 silver badges18 bronze badges




          1,0202 gold badges8 silver badges18 bronze badges












          • Still doesn't work.

            – Paulo
            Mar 26 at 17:34











          • @Paulo are you having both post methods in code?

            – Manish Kumawat
            Mar 26 at 17:39











          • what do you mean by that?

            – Paulo
            Mar 26 at 17:57











          • @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

            – Manish Kumawat
            Mar 26 at 17:59











          • I'm trying one at a time, but I tested both approaches

            – Paulo
            Mar 26 at 18:02

















          • Still doesn't work.

            – Paulo
            Mar 26 at 17:34











          • @Paulo are you having both post methods in code?

            – Manish Kumawat
            Mar 26 at 17:39











          • what do you mean by that?

            – Paulo
            Mar 26 at 17:57











          • @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

            – Manish Kumawat
            Mar 26 at 17:59











          • I'm trying one at a time, but I tested both approaches

            – Paulo
            Mar 26 at 18:02
















          Still doesn't work.

          – Paulo
          Mar 26 at 17:34





          Still doesn't work.

          – Paulo
          Mar 26 at 17:34













          @Paulo are you having both post methods in code?

          – Manish Kumawat
          Mar 26 at 17:39





          @Paulo are you having both post methods in code?

          – Manish Kumawat
          Mar 26 at 17:39













          what do you mean by that?

          – Paulo
          Mar 26 at 17:57





          what do you mean by that?

          – Paulo
          Mar 26 at 17:57













          @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

          – Manish Kumawat
          Mar 26 at 17:59





          @Paulo In your example, you have described 2 approaches. Do you have both them in running code? or you are trying one at a time?

          – Manish Kumawat
          Mar 26 at 17:59













          I'm trying one at a time, but I tested both approaches

          – Paulo
          Mar 26 at 18:02





          I'm trying one at a time, but I tested both approaches

          – Paulo
          Mar 26 at 18:02








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55362521%2fhow-to-get-api-post-request-with-json-data%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현