Skip to Content
Libro de cocina de patrones y prácticas de API Web RESTful
book

Libro de cocina de patrones y prácticas de API Web RESTful

by Mike Amundsen
September 2024
Intermediate to advanced
470 pages
12h 49m
Spanish
O'Reilly Media, Inc.
Content preview from Libro de cocina de patrones y prácticas de API Web RESTful

Apéndice D. Uso de HyperCLI

La utilidad hyper es un sencillo shell/REPL de línea de comandos para interactuar con servicios/API en línea. Aunque es un cliente HTTP totalmente funcional, hyper es especialmente bueno para tratar con servicios hipermedia, como Collection+JSON, SIREN y HAL. Hay planes para añadir compatibilidad con PRAG+JSON, MASH+JSON y posiblemente UBER en el futuro. También se pueden añadir otros tipos de medios mediante plug-ins.

Junto con los comandos HTTP y los que tienen en cuenta el tipo de medio, hyper también admite algunas funciones prácticas, como comandos shell, gestión de archivos de configuración y una pila LIFO para gestionar variables de memoria local.

Nota

Puedes acceder a tutoriales, ejemplos, el código fuente y la última versión de la herramienta HyperCLI a través de la página de inicio de HyperCLI.

¡Hola, Hyper!

Aquí tienes un script HyperLANG super sencillo:

GOTO https://company-atk.herokuapp.com

Y así es como se hace:

  1. Asegúrate de que has instalado la última actualización del HyperCLI:

    $> npm install -g @mamund/hyper
  2. Inicia el REPL de HyperCLI:

    $> hyper
  3. Escribe el siguiente comando y pulsa Intro:

    > GOTO https://company-atk.herokuapp.com

Puede que el servicio de muestra tarde unos segundos en iniciarse, pero al final deberías ver la siguiente respuesta:

STATUS 200
https://company-atk.herokuapp.com
application/forms+json; charset=utf-8

También puedes ver los detalles de la solicitud/respuesta con estos comandos:

SHOW REQUEST SHOW RESPONSE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Libro de cocina de Java, 5.ª edición

Libro de cocina de Java, 5.ª edición

Ian F. Darwin
Patrones de diseño para aplicaciones nativas en la nube

Patrones de diseño para aplicaciones nativas en la nube

Kasun Indrasiri, Sriskandarajah Suhothayan

Publisher Resources

ISBN: 9781098199432