Gist 92ed5ad616da212ef7199f955f413567
✓ Published0🌍 Public
CCarlos-Augusto
Last edited Sep 6, 2023
Created on Jul 24, 2021
This example shows a Java client that sends a COVID-19 vaccination certificate request to a demo certification API over HTTPS, using a custom SSL keystore for mutual authentication. It first performs a GET request to the base URL, then posts a JSON test payload containing patient and test data to the `/api/certify/v2/issue` endpoint, requesting a CBOR-encoded response. The code uses Apache HttpClient 4.5’s `CloseableHttpClient`, `HttpClients.custom()`, and `SSLContexts.custom()` with a Java KeyStore, along with `StringEntity` and `ContentType` to set the JSON body. Responses, including status lines, headers, and body text, are printed to the console.
AI-generated description