issue here with the delete request (in angular 4), as i get a
requestheaders does not exist in the type requestoptionargs
below is my code:
myMethod(id: string, reason: string): Observable<any> {
const reqHeaders = new Headers({
'Content-Type': 'application/json'
});
const body =
`{"reqId": "${id}",
"reqReason": "${reason}"
}`;
return this.httpClient.delete(
`http://localhost:188/.../1677777555`,
new RequestOptions({ reqHeaders, body }))
.map(rez => JSON.parse(rez))
// .catch(error => this.handleError(error))
;
}
on this line is where i get the error new RequestOptions({ requestHeaders, body }))
Any obvious faults here?
Edit: another variant
Same body as before and:
const options = new RequestOptionsArgs({
body: body,
method: RequestMethod.Delete
});
return this.httpClient.request('http://testAPI:3000/stuff', options);
}
now I get a:
RequestOptionsArgs refers to a type but is beingused as a value here