AnswerBun.com

How can i do a request an external url?

Stack Overflow Asked by mikkylekyle on January 12, 2021

How can do a request to endpoint from express.js? i want to do a POST request to an url external,
i am using request library but this is deprecated also i want to send this data req.body.options

app.post(
  'sendData',
  async (req, res) => {
    var url =
      'http://myUrl'
    request.post(
      url,
      {
        options : req.body.options,
      },
      (error, res, body) => {
        if (error) {
          console.error(error)
          return
        }

I have tried but dont work that code, i want to use http

Add your own answers!

Related Questions

RecyclerView inside NestedScrollview alternative

5  Asked on January 29, 2021 by user1851366

   

Why I can not see bugs from Findbugs on SonarQube?

1  Asked on January 29, 2021 by user14260568

       

How to render an element within a function in React?

3  Asked on January 28, 2021 by peppa-box

   

3 errors on function from vue js

1  Asked on January 28, 2021 by nicolas-vanhuynegem

       

variadic template, Range, C++

1  Asked on January 28, 2021 by hrant-nurijanyan

         

AWS Lambda import module error in python

21  Asked on January 28, 2021 by nithin-k-anil

     

React native maps rerender on marker press

1  Asked on January 28, 2021 by enguerranws

       

Python: overwrite text file – string placeholder

1  Asked on January 28, 2021 by thommy-bee

       

Wrangling dataframes with Dplyr

1  Asked on January 28, 2021

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir