Questions tagged [sphttpclient]
The sphttpclient tag has no usage guidance.
10
questions
2
votes
2answers
1k views
Update List Item SPfx not working
Below is the code, which is not working, shows below error
An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected.
const body: string = ...
0
votes
0answers
30 views
Service Injection to React Component (is missing type“nameofmyinterface” []: length, pop, push, concat, and 16 more (SPFx))
I have this service that gets all the list items from a Sharepoint List (Promise)
public getVehicles(): Promise<IVehiclesListItem[]> {
let promise: Promise<IVehiclesListItem[]> = new ...
0
votes
1answer
2k views
Uncaught Type Error: Cannot read property 'post' of undefined
The below is my code
import * as React from 'react';
import styles from './PostTest.module.scss';
import { IPostTestProps } from './IPostTestProps';
import { escape } from '@microsoft/sp-lodash-...
0
votes
1answer
76 views
SPFx: Error in REST API call spHttpClient.get()
In my child component:
I tried to make a rest call from spfx web part to get people results, but it throws errors.
this.props.context.spHttpClient.get(query);
Error: can't read property get of ...
1
vote
2answers
112 views
SPFx - Update a calculated column formula
I am trying to use this.context.spHttpClient.post() to update a calculated column formula in my SPFx WebPart.
I get a status code of 400 with the error message: "The parameter __metadata does not ...
0
votes
1answer
469 views
SPHttpClient undefined error: Using React JS to add item in SharePoint list
I'm trying to add an item in SharePoint Online list using SPFx solution where I'm using React JS to perform the action.
Below is the copied code, when debugging it says that:
"VM242:1 Uncaught ...
0
votes
1answer
280 views
Problem with SPFx TypeScript json.value.map(k,i) & query via getuserbyid()
Firstly I'll start with extra question:
I'm trying to get data by _api/web/getuserbyid() API call in code.
Do You guys know why there is no option for filtering by query for specific data? I mean by:
...
1
vote
0answers
923 views
SPFx TypeScript json response from spHttpClient as array
i want to get data to WebPart from the SharePoint list.
but some of the data are eg. PeoplePicker or Multiple line of text
and I have result shown as:
<div class="...
0
votes
2answers
2k views
'.get' undefined on 'this.context.SPHttpClient'
I am new to SharePoint and I am having trouble making API calls.
child component below:
import * as React from 'react';
import styles from './HelloWorld.module.scss';
import { IHelloWorldProps } ...
2
votes
1answer
1k views
Send an email with SPHttpClient
I'm working on a web part for SharePoint 2016 on-prem and I want to send an email from the current user. I cannot use @pnp/sp library as it's not supported with TypeScript 2.2.2 and I'm unable to ...