Forum Discussion

Vani_metamicro's avatar
Vani_metamicro
Copper Contributor
Feb 18, 2020

post request - errors

Hello Everyone,

I created URL for post request by using MSFlow. 

In share point framework, I am sending a post request and just expecting response by writing the below lines of code

 private _getListData(): Promise<any> {
const spOpts:ISPHttpClientOptions= {headers: { 'Content-Type': 'value' }, body:"value" };
const postURl = "

";
return this.context.spHttpClient
.post(postURl, SPHttpClient.configurations.v1, spOpts)
.then((response: any) => {
console.log('Post request is success', response);
return response.json();
});
}

 

When i check the URL in Postman, the post request is working okay and i am receiving the response back. but When i try that URL in share point framework(HelloWorldWebPart.ts),  I get error

Uncaught (in promise) Error: Unable to determine web URL
at Function.e.getWebUrlFromRequestUrl (sp-webpart-workbench-assembly_en-us_8c5f51c6434ef13aebeff59cb3564410.js:19)
at sp-webpart-workbench-assembly_en-us_8c5f51c6434ef13aebeff59cb3564410.js:19

 

Please could some one help me to fix this error, i am not sure where i am doing it incorrect. 

 

Resources