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

156
Views
¿Utiliza Fetch para recopilar información de una API de backend?

En mi backend (Ruby) llamo a una API de traducción, que me devuelve el texto traducido. Luego, necesito mostrar este texto traducido cuando un usuario hace clic en mi componente TranslationButton.vue, no sé cómo acceder correctamente a mi API de back-end a través de la búsqueda. ¿Cómo se descubre el punto final correcto para usar, cuando nos referimos a una llamada API de backend?

Mensajes.vue

 methods { loadTranslations() { fetch('#whatgoeshere') .then(function(response) { return response.json(); }) .then(function(myJson) { console.log(myJson) }); }, }

solicitud.rb

 def make_request response = Faraday.post('https://api.deepl.com/v2/translate', auth_key: 'authkeyhere', text: @final_ticket, target_lang: 'DE', source_lang: 'EN') if response.status == 200 body = response.body translated_text = body.split('"')[-2] return translated_text else raise InvalidResponseError unless response.success? end end
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tenga una configuración de ruta para su método make_request. Luego golpea esa ruta desde tu frente.

es decir fetch("localhost:3000/make_request?maybe_some_query_param=whatever_you_are_translating") y el resto de lo que tiene se ve bien.

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!