Forum Discussion
Vani_metamicro
Mar 03, 2020Copper Contributor
post request is not working
Hello,
I have created a Post URL using MS flow. I wanted to use the post URL in share point framework. I created a function as below. The response which i get back is Authentication {code: "AuthorizationFailed", message: "The authentication credentials are not valid}
Please may i know what am i doing incorrect? The Post URL works fine in postman.
private _getListData(): Promise<any> {
const postUrl = "https://prod-???????????????????????????????????/triggers/manual/paths/invoke?api-version=2016-06-01&sp=/triggers/manual/run&sv=1.0&sig=0RTMbBNtEVHqn5NBu-UiMMLWRLAQdV1FKJHGTqpTQsA";
const spOpts: ISPHttpClientOptions = {
body: `{ Title: 'Developer Workbench', BaseTemplate: 100 }`
};
this.context.spHttpClient.post(`${postUrl}/_api/web/lists`, SPHttpClient.configurations.v1, spOpts)
.then((response: SPHttpClientResponse) => {
// Access properties of the response object.
console.log(`Status code: ${response.status}`);
console.log(`Status text: ${response.statusText}`);
response.json().then((responseJSON: JSON) => {
});
return;
}
No RepliesBe the first to reply