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

120
Views
buscar cuerpo vacío cuando se usa opera

Estoy tratando de llamar a mi restapi (creado con java spring) para autorizar al usuario en vuejs. Para hacer eso, llamo a una solicitud HTTP usando fetch. Esto funciona bien en Chrome y Firefox, pero no en Opera y Edge.

Este es el código que estoy ejecutando en el método montado():

 fetch( 'http://localhost:8083/oauth2/user', { method: 'GET', headers: { 'Authorization': localStorage.accesstoken, 'Accept': 'application/json', 'Content-Type': 'application/json', }, } ) .then(res => { console.log("Status: " + res.status) if (res.status === 200) { return res.json(); } else { console.log(res.text()) } } ) .then(res => { console.log("jsondata: " + res) } ) .catch((e) => { console.log(e) } )

Correr en Ópera :

 Status: 200 SyntaxError: Unexpected end of JSON input

Respuesta: "Esta solicitud no tiene datos de respuesta disponibles".

Corriendo en cromo

 Status: 200 jsondata: [object Object]

Respuesta: <objeto JSON correcto que se supone que debe tener>

Este es el arranque de primavera de Java que llamo:

 @CrossOrigin @GetMapping("/oauth2/user") ResponseEntity<String> getUserInfo(@RequestHeader("Authorization") String authentication){ try { PrimeUser user = authenticateUser(authentication); assert user != null; return ResponseEntity.ok() .body(new Gson().toJson(user)); } catch (Exception e) { e.printStackTrace(); return ResponseEntity.internalServerError() .body(e.getMessage()); } }
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!