Search... Ctrl + K

Get an endpoint status and statusText (http)
One script reply has been approved by the moderators Verified

Created by admin 17 days ago Used 7640 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
export async function main(endpoint: string) {
  try {
    const res = await fetch(endpoint)
    return { status: res.status, statusText: res.statusText }
  } catch (e) {
    return { status: -1, statusText: e.toString()}
  }
}

Submitted by admin 17 days ago

Edited 17 days ago

No comments yet