Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Axios post is not working with two parameters in React

I have a problem with API. This is my code

          onSubmit={async (values) => {
            const jsonData = {
              ...values,
              address: JSON.stringify(values.address),
              products: JSON.stringify(values.products),
            };

            let fileData = new FormData();
            fileData.append("file", values.file[0]);

            await axios.post("https://nehra.az/api/add-supplier", jsonData, fileData);
          }}

Api does not read the second parameter and my result is this enter image description here

if I change jsonData with fileData, the jsonData is not read. Like this

await axios.post("https://nehra.az/api/add-supplier", fileData, jsonData);

enter image description here

How can I solve this problem? I need that API must be work with two parameter. Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!