Putting it all Together
Using the
The following sections contain code examples for requests of the four most‑common HTTP verbs, and each will use the Swagger Petstore, a public demonstration REST API found at https://petstore.swagger.io/.
These examples assume you have classes that mirror the data model of the REST service (for example, a Pet class description). You can do this manually by inspecting the API documentation for the REST service you are consuming or by generating it automatically, which we will cover under "OpenAPI Imports", later in this white paper.