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

139
Views
Estoy tratando de publicar mi json en la url. y recibo el error 405, pero puedo ver la carga útil de la solicitud en las herramientas de desarrollo de Chrome. Qué estoy haciendo mal
function addUser(username, email, callback) { var xhr = new XMLHttpRequest(); var response; var success = !!Math.round(Math.random()); console.log(success); if (!success) { response = JSON.stringify({ success: success, error: "Oups, something went wrong!", }); } else { response = JSON.stringify({ success: success, user: { username: username, email: email, }, }); } console.log(response); xhr.open("POST", "/echo/json/", true); xhr.onload = function () { if (xhr.status === 200) { callback(JSON.parse(xhr.responseText)); } }; xhr.setRequestHeader( "Content-type", "application/x-www-form-urlencoded" ); xhr.send("json=" + response); }

Mi función para llamar al método de publicación ... Estoy tratando de llamar a esta función con el nombre de usuario y el correo electrónico como entradas que obtendré de las entradas de formulario HTML.

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!