new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Cloudflare Workers · Wrangler · all subjects

integrations/apis

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Use fetch API to integrate with third-party APIs

To integrate with third-party APIs from Cloudflare Workers, use the fetch API to make HTTP requests to the API endpoint. Then use the response data to modify or manipulate your content as needed.

Example fetch request to third-party API

The following example shows how to make a fetch request to a third-party API endpoint, retrieve JSON data from the response, and return it: ```js async function handleRequest(request) { // Make the fetch request to the third party API endpoint const response = await fetch("https://weather-api.com/endpoint", { method: "GET", headers: { "Content-Type": "application/json", }, }); // Retrieve the data from the response const data = await response.json(); // Use the data to modify or manipulate your content as needed return new Response(data); } ```

Use mTLS certificates for client certificate authentication

For services that require mTLS authentication, use mTLS certificates to present a client certificate when communicating with external APIs.

Cache API for optimizing third-party API requests

Use the Cache API to cache data from third-party APIs. This allows you to optimize cacheable requests made to the API and reduce unnecessary requests to external services.

Custom Domains for communicating with external APIs

Use Custom Domains when communicating with external APIs. This treats your Worker as your core application and can be important for APIs that validate the origin or domain of requests.

Give your agent this brain