|
2 | 2 |
|
3 | 3 | A typical scenario in a Microservices architecture is the remote invocation of remote REST HTTP endpoints. Quarkus provides a typed REST client that follows the https://github.com/eclipse/microprofile-rest-client[MicroProfile REST Client, window=_blank] specification. |
4 | 4 |
|
5 | | -Let's create a REST client that accesses https://swapi.dev[window=_blank] to get additional information about Movies. The endpoint we're interested in is this one: |
| 5 | +Let's create a REST client that accesses https://swapi.info[window=_blank] to get additional information about Movies. The endpoint we're interested in is this one: |
6 | 6 |
|
7 | | -* `api/films/?search=\{title\}`, which returns specific info about the given movie. |
| 7 | +* `api/films/\{id\}`, which returns specific info about the given movie. |
8 | 8 |
|
9 | 9 | [.console-output] |
10 | 10 | [source, json] |
11 | 11 | ---- |
12 | 12 | { |
13 | | - "count": 1, |
14 | | - "next": null, |
15 | | - "previous": null, |
16 | | - "results": [ |
17 | | - { |
18 | | - "title": "The Empire Strikes Back", |
19 | | - "episode_id": 5, |
20 | | - "opening_crawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space....", |
21 | | - "director": "Irvin Kershner", |
22 | | - "producer": "Gary Kurtz, Rick McCallum", |
23 | | - "release_date": "1980-05-17", |
24 | | - "created": "2014-12-12T11:26:24.656000Z", |
25 | | - "edited": "2014-12-15T13:07:53.386000Z", |
26 | | - "url": "https://swapi.dev/api/films/2/" |
27 | | - } |
28 | | - ] |
| 13 | + "title": "A New Hope", |
| 14 | + "episode_id": 4, |
| 15 | + "opening_crawl": "It is a period of civil war.\r\nRebel spaceships, striking\r\nfrom a hidden base, have won\r\ntheir first victory against\r\nthe evil Galactic Empire.\r\n\r\nDuring the battle, Rebel\r\nspies managed to steal secret\r\nplans to the Empire's\r\nultimate weapon, the DEATH\r\nSTAR, an armored space\r\nstation with enough power\r\nto destroy an entire planet.\r\n\r\nPursued by the Empire's\r\nsinister agents, Princess\r\nLeia races home aboard her\r\nstarship, custodian of the\r\nstolen plans that can save her\r\npeople and restore\r\nfreedom to the galaxy....", |
| 16 | + "director": "George Lucas", |
| 17 | + "producer": "Gary Kurtz, Rick McCallum", |
| 18 | + "release_date": "1977-05-25", |
| 19 | + "characters": [ |
| 20 | + "https://swapi.info/api/people/1", |
| 21 | + "https://swapi.info/api/people/2", |
| 22 | + "https://swapi.info/api/people/3", |
| 23 | + "https://swapi.info/api/people/4", |
| 24 | + "https://swapi.info/api/people/5", |
| 25 | + "https://swapi.info/api/people/6", |
| 26 | + "https://swapi.info/api/people/7", |
| 27 | + "https://swapi.info/api/people/8", |
| 28 | + "https://swapi.info/api/people/9", |
| 29 | + "https://swapi.info/api/people/10", |
| 30 | + "https://swapi.info/api/people/12", |
| 31 | + "https://swapi.info/api/people/13", |
| 32 | + "https://swapi.info/api/people/14", |
| 33 | + "https://swapi.info/api/people/15", |
| 34 | + "https://swapi.info/api/people/16", |
| 35 | + "https://swapi.info/api/people/18", |
| 36 | + "https://swapi.info/api/people/19", |
| 37 | + "https://swapi.info/api/people/81" |
| 38 | + ], |
| 39 | + "planets": [ |
| 40 | + "https://swapi.info/api/planets/1", |
| 41 | + "https://swapi.info/api/planets/2", |
| 42 | + "https://swapi.info/api/planets/3" |
| 43 | + ], |
| 44 | + "starships": [ |
| 45 | + "https://swapi.info/api/starships/2", |
| 46 | + "https://swapi.info/api/starships/3", |
| 47 | + "https://swapi.info/api/starships/5", |
| 48 | + "https://swapi.info/api/starships/9", |
| 49 | + "https://swapi.info/api/starships/10", |
| 50 | + "https://swapi.info/api/starships/11", |
| 51 | + "https://swapi.info/api/starships/12", |
| 52 | + "https://swapi.info/api/starships/13" |
| 53 | + ], |
| 54 | + "vehicles": [ |
| 55 | + "https://swapi.info/api/vehicles/4", |
| 56 | + "https://swapi.info/api/vehicles/6", |
| 57 | + "https://swapi.info/api/vehicles/7", |
| 58 | + "https://swapi.info/api/vehicles/8" |
| 59 | + ], |
| 60 | + "species": [ |
| 61 | + "https://swapi.info/api/species/1", |
| 62 | + "https://swapi.info/api/species/2", |
| 63 | + "https://swapi.info/api/species/3", |
| 64 | + "https://swapi.info/api/species/4", |
| 65 | + "https://swapi.info/api/species/5" |
| 66 | + ], |
| 67 | + "created": "2014-12-10T14:23:31.880000Z", |
| 68 | + "edited": "2014-12-20T19:49:45.256000Z", |
| 69 | + "url": "https://swapi.info/api/films/1" |
29 | 70 | } |
30 | 71 | ---- |
31 | 72 |
|
@@ -363,10 +404,10 @@ curl -w '\n' localhost:8080/movie?year=1980 |
363 | 404 | { |
364 | 405 | "title": "The Empire Strikes Back", |
365 | 406 | "releaseDate": "1980-05-17", |
366 | | - "episodeId": 0, |
367 | | - "producer": "Gary Kurtz, Rick McCallum", |
| 407 | + "episode_id": 5, |
| 408 | + "opening_crawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space....", |
368 | 409 | "director": "Irvin Kershner", |
369 | | - "opening_crawl": "It is a dark time for the\r\nRebellion. Although the Death\r\nStar has been destroyed,\r\nImperial troops have driven the\r\nRebel forces from their hidden\r\nbase and pursued them across\r\nthe galaxy.\r\n\r\nEvading the dreaded Imperial\r\nStarfleet, a group of freedom\r\nfighters led by Luke Skywalker\r\nhas established a new secret\r\nbase on the remote ice world\r\nof Hoth.\r\n\r\nThe evil lord Darth Vader,\r\nobsessed with finding young\r\nSkywalker, has dispatched\r\nthousands of remote probes into\r\nthe far reaches of space...." |
| 410 | + "producer": "Gary Kurtz, Rick McCallum" |
370 | 411 | } |
371 | 412 | ] |
372 | 413 | ---- |
0 commit comments