Skip to content

Instantly share code, notes, and snippets.

View PeterWCox's full-sized avatar
🏠
Working from home

Peter Cox PeterWCox

🏠
Working from home
  • London, UK
View GitHub Profile
@TBag
TBag / SPFxhttpClientExample.ts
Created February 6, 2017 14:22
How to set headers and body for SPFx httpClient
import { HttpClient, IHttpClientOptions, HttpClientResponse } from '@microsoft/sp-http';
private makeRequest(value1: string, value2: string, value3: string): Promise<HttpClientResponse> {
const postURL = "https://REST-API-URL";
const body: string = JSON.stringify({
'name1': value1,
'name2': value2,
'name3': value3,