Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to send the req object as whole in another request e.g axios and process the req object in api rather than inside route that will be some where else.
here is my route code

app.post("/adddata", async (req, res) => {
  
  const result = await axios.post("fun/add",req);
  res.send(data :result.data );

});


here I will have images and data in req object. so i will have to upload the images first get their ids and then pass them to api. rather i want do that image upload inside that api

The req object that i am sending in API.post (which is an axios request), i want this req object treated as the actual req object in Axios request to some external api or something like that. there may some way out.

Thank you

What I have tried:

tried to send the req objext as a whole, but axios post request does not accept it and needs to send this as a param
Posted
Updated 21-Feb-22 21:29pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900