INTEGRATIONS / HTTP RECIPE

Vera, meet Java.

The generated Java example uses the JDK HttpClient, a 45-second timeout and explicit status handling.

← All integrations

Your first connection.

  1. 01

    Use Java 11 or newer and export VERA_BASE_URL and VERA_API_KEY.

  2. 02

    Save the generated class as WaggleRequest.java and compile it with the standard JDK.

  3. 03

    Check statusCode and retain the response body and request ID when a call fails.

Build the request.

Set the environment variables in your terminal for these code examples. In automation tools, enter the URL and credentials in the tool’s own fields.

import java.net.URI;
import java.net.http.*;
import java.time.Duration;

var request = HttpRequest.newBuilder()
    .uri(URI.create(System.getenv("VERA_BASE_URL").replaceAll("/$", "") + "/api/vera/v1/scrape"))
    .timeout(Duration.ofSeconds(45))
    .header("Authorization", "Bearer " + System.getenv("VERA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"url\": \"https://example.com\"\n}"))
    .build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() / 100 != 2) throw new RuntimeException("Vera HTTP " + response.statusCode() + ": " + response.body());
System.out.println(response.body());

This edits a code example. It does not send a request or use credits.

Run a request in your workspace
YOUR PRIVACY

Choose what works for you. You can reopen these settings from the footer at any time.

Essential

Always active

Sign-in, security and preferences you ask us to remember. These keep the service working.

Analytics

Optional Vera visitor reporting counts visits and active browsers; Google Analytics may also measure selected clicks. We don’t send form contents, requested URLs, search queries, passwords, API keys or account emails. Turn it off here at any time.

Advertising

Not in use

No advertising cookies or remarketing tags.

Your choice is stored on this browser for 180 days. Read the cookie policy ↗