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

261
Views
Cuando POST de Nodejs a una API ejecutada en Django rest framework. Devuelve 200 ok pero en la base de datos no se guarda nada
  1. Cuando POST de Nodejs a una API ejecutada en Django rest framework. Devuelve 200 ok pero en la base de datos no se guarda nada. 2. Las llamadas Api aquí se ejecutan en Django restframework.

  2. La base de datos utilizada--> Postgres

  3. fragmento: js Entonces html

     function handleSubmit(event) { event.preventDefault(); var x = document.getElementById('Date'); var y = x.value; document.getElementById('Date').value = y; if (x != y) { x = document.getElementById('Date'); y = x.value; console.log(y); const data = document.getElementById('form'); fetch('http://127.0.0.1:8000/sender', { method: 'POST', // or 'PUT' headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(data), }).then(response => response.json()).then(data => { console.log('Success:', data); }).catch((error) => { console.error('Error:', error); }); } else { x = document.getElementById('Date'); y = x.value; console.log(y); } } const form = document.querySelector('form'); form.addEventListener('submit', handleSubmit);
     <form id="form"> <label for="SenderId">Your Id:</label> <input type="text" name="SenderId" id="id"> <br> <label for="SenderName">Your Name:</label> <input type="text" name="SenderName" id="SenderName"> <br> <label for="SenderAddress">Your Address:</label> <input type="text" name="SenderAddress" id="SenderAddress"> <br> <label for="SenderPO">Your PO:</label> <input type="text" name="SenderPostOffice" id="SenderPostOffice"> <br> <label for="Date">Date:</label> <input type="date" name="Date" id="Date"> <label for="PackageCount">Package Count:</label> <input type="text" name="PackageCount" id="PackageCount"> <br> <button type="submit">Send</button> </form> <!-- end snippet -->
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!