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

299
Views
React JS - ¿Cómo pasar la solicitud del cuerpo en GET de fetch?

Mis parámetros de URL son demasiado grandes. Así que estoy tratando de obtener ese contenido pasándolo en request.body . La API funciona bien con el cartero durante las pruebas. Pero no puedo buscarlo en React

Estoy usando ExpressJS

API: http://localhost:5000/api/v1

Código de reacción:

 let result = await fetch("http://localhost:8080/autocomplete",{ method: 'GET', body: { "text": "something new" } }); console.log(await result.json()) // Not get my data here

ERROR:

 TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have a body.

¿Cómo resuelvo este problema?

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

0

se espera
De los documentos de mozilla, se menciona: The HTTP GET method requests a representation of the specified resource. Requests using GET should only be used to request data (they shouldn't include data).
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET

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!