This is an example call of @stevekrouse/insecureFetch

1
2
3
4
5
6
import { insecureFetch } from "https://esm.town/v/stevekrouse/insecureFetch";
const url = "https://atmos.washington.edu/cgi-bin/uw.cgi?20240408";
const data = await insecureFetch(url);
const text = await data.text();
console.log(text);

Insecure SSL Cert Fetch

If you need to make a fetch request to a website with a dubious or non-standard SSL certificate, you can use this proxy we made on Cloudflare workers (which doesn't verify SSL certs): https://unsecure-fetch.val-town.workers.dev/

Example usage below.

1
2
3
4
5
6
7
8
9
import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
const url = "https://assignment-api.uspto.gov/patent/basicSearch?query=1234567&fields=main&rows=20";
const proxyURL = new URL("https://unsecure-fetch.val-town.workers.dev");
proxyURL.searchParams.set("url", url);
// console.debug("proxyUrl: %s", proxyURL);
// ==> proxyUrl: https://unsecure-fetch.val-town.workers.dev/?url=https%3A%2F%2Fassignment-api.uspto.gov%2Fpatent%2FbasicSearch%3Fquery%3D1234567%26fields%3Dmain%26rows%3D20
console.log(await fetchText(proxyURL.href));
1
Next