I am trying to update a resource.So, I am trying to access the resource using PUT in angular service.
RollBackBatchById(selectedBatchId: number) {
const params = new HttpParams();
params.append('resourceId', resourceId.toString());
let headers = new HttpHeaders();
headers.append('Content-Type', 'multipart/form-data');
headers.append('Accept', 'application/json');
const httpOptions = { headers: headers };
return this._httpClient.put(this.base_url + 'api/WebApi/UpdateResource', { params: params })
.subscribe((res: Response) => {
});
}
In my WebApi Controller
[HttpPut]
[Route("UpdateResource")]
public TransactionResult UpdateResource([FromQuery]string resourceId)
{
var id = resourceId;
}
So, when I'm trying to access my resourceId it is coming as null.And when I am seeing in the network, I couldn't find the resourceId being appended to the URL.
Could anyone please help me with this.