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

87
Views
La URL está vacía al definir un objeto de respuesta

Estoy tratando de crear una solicitud de respuesta como esa:

 Response { type: "basic", url: "https://mywebsite.com/download?lang=en", status: 200, ok: true, statusText: "SuperSmashingGreat!"}

Leí aquí cómo establecer un nuevo objeto de Response y probé:

 var myBlob = new Blob(); var init = { "status": 200, "statusText": "SuperSmashingGreat!", "url": "https://mywebsite.com/download?lang=en", "ok": "true" }; var myResponse = new Response(myBlob, init); console.log(myResponse)

Después de ejecutarlo, recibí este objeto de Response sin la url (es una url: "" ):

 { type: "default", url: "", redirected: false, status: 200, ok: true, statusText: "SuperSmashingGreat!", headers: Headers, body: ReadableStream, bodyUsed: false }

¿Por qué no se está configurando?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Gracias por @Blair Nangle por el comentario, basado en este sitio web .
Solía:

 Object.defineProperty(resp, "url", { value: "foobar" });

Código de trabajo completo:

 var myBlob = new Blob(); var init = { "status": 200, "statusText": "SuperSmashingGreat!", "url": "https://mywebsite.com/download?lang=en", "ok": "true" }; var resp = new Response(myBlob, init); Object.defineProperty(resp, "resp", { value: "https://mywebsite.com/download?lang=en" }); console.log(myResponse)
about 4 years ago · Juan Pablo Isaza Report
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!