Last active
March 30, 2023 06:55
-
-
Save aycabas/188a5b82cb0bd43976a0320b1fcced2b to your computer and use it in GitHub Desktop.
an HTTP call to DevOps API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DevOpsModel } from "../models/devOpsModel"; | |
export async function DevOpsWorkItems(): Promise<DevOpsModel[]> | |
{ | |
try | |
{ | |
let devopsItems: DevOpsModel[] = []; | |
const req = await fetch( "https://dev.azure.com/ORGANIZATION_NAME/PROJECT_NAME/_apis/wit/workitems?ids=1,2,3,4,5&api-version=7.0", | |
{ method: "GET", headers: { "Content-Type": "application/json; charset=utf-8;", Authorization: "Basic " + btoa("Basic" + ":" + "DEVOPS_PERSONAL_ACCESS_TOKEN"), }, }) | |
.then((response) => response.json()).then((req) => { return req; }); | |
return; | |
} | |
catch (e) | |
{ | |
throw e; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment