Questions tagged http-delete

Explore the latest questions and answers asked by our top developers.

Angular : Perfoming successive HTTP-Delete in a loop doesn’t work

I’m developing a website with Angular CRUD operations, but I struggle to perform successive delete on my database. I recover my IDs which need to be deleted from my database in an array called « this.checkedLogs » (this part does work). Then, when I click on a button I call a function which used to […]

Angular Service Delete method

I am trying to delete a customer using angular services delete method but I don’t know how can I pass id parameter dynamically from the angular component. Can anyone tell me how to pass id dynamically? deleteCustomerById(id: number): Observable { const httpOptions = { headers: new HttpHeaders({ ‘Content-Type’: ‘application/json’}) }; return this.http.delete(‘http://localhost:58274/api/Customers/{id}’ + id, httpOptions); […]

By sajid
Published
Categorized as angular, angular-services, http-delete Tagged , ,

Delete method in Angular is not deleting

I am trying to do a really basic CRUD in my first Angular application and I am having issues with the Delete method. There are no errors, the id parameter is passed correctly throughout the application (checked in the console), but the item is not being deleted. Basically nothing happens. The "database" is a file […]

By Questieme
Published
Categorized as angular, html, http-delete, service, typescript Tagged , , , ,

Getting error when trying to perform Delete operation in Angular

I am receiving the following error when I am trying to perform a delete operation in angular CRUD operations: "ERROR in src/app/home/home.component.ts(29,37): error TS2322: Type ‘Headers’ is not assignable to type ‘HttpHeaders | { [header: string]: string | string[]; }’. Type ‘Headers’ is not assignable to type ‘{ [header: string]: string | string[]; }’. Index […]

By Soccerplayer97
Published
Categorized as angular, crud, http-delete, typescript Tagged , , ,

delete of HttpClient causing error callback when backend returns success response

I’m trying to delete a simple student object by It’s ID. It works fine. but instead of showing the successful message, It returns the success message as an error message. the backend code in java -> the controller code: @DeleteMapping("/student/{$id}") public String deleteStudent(@PathVariable int $id){ return student_service.deleteStudent($id); } the service code: public String deleteStudent(int $id){ […]

Angular8: Only Allow item to be deleted within 30 minutes of creation

I have an NGX table of certifications. The user is able to create new certifications which are added to the table. Each certification has a delete button to remove the certification from the table. I want the delete button to only be available within 30 minutes after user has created a new certification. I’m not […]

How to delete in section that contain subsection

In my help dialog, a user can create section and subsection. I’m trying to implement a function where a user can delete a sections even if that section contain one or multiple subsection. Right now: I can delete a single section if that section doesn’t have any subSection. I can also delete each subsection. The […]

How to delete a section that contain subsection

In my help dialog, a user can create section and subsection. I’m trying to implement a function where a user can delete a section even if that section contains one or multiple subsection. I can delete a single section if that section doesn’t have any subSection and I can also delete any subsection. The problem […]

how can I call a delete method properly?

It’s actually the first time that I’m trying to call a delete method. my code in my dataService is: deleteMeaningItem(data): Observable<Result> { return this.http.delete<Result>(url, data); } and in component: this.dataService.deleteMeaningItem({id: id}).subscribe(res => { if (res.status) { //do something } }); but I’m getting 415 Unsupported Media Type error! I’ve also tried to send Content-Type in […]

Angular: How to delete multiple data using http.delete or http.request

I can delete an item when mocking the server with the code below: var result = <Promise<ArrayBuffer>> this.http .request(‘delete’, `api/accounts/1`) .toPromise(); I want to delete multiple items but want to do it in batch instead of separated var result = <Promise<ArrayBuffer>> this.http .request(‘delete’, `api/accounts`, { headers: new HttpHeaders({ ‘Content-Type’: ‘application/json’, }), body }) .toPromise(); This […]

By LittleFunny
Published
Categorized as angular, http-delete, mocking Tagged , ,
1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq