React JS Http Delete Request Example

Hello all! In this article, we will talk about http delete request in react js. We will look at example of axios delete request example react js. This article goes in detailed on http delete request in react js. I’m going to show you about react http delete request example. You just need to some step to done react send http delete request.

If you want to learn how to send http delete request with react then i will help you step by step instruction for sending http request using axios react. i will give you very simple example to send http delete request using axios and react.

Axios is a npm package and the provide to make http request from your application. in this example we will use "jsonplaceholder" api to delete data using axios package.

So, let's see bellow example code and preview:


Example Code:

import React from 'react';

import axios from 'axios';

export default class PostList extends React.Component {

state = {

posts: []


componentDidMount() {


.then(res => {

const posts = res.data;

this.setState({ posts });



deleteRow(id, e){


.then(res => {



const posts = this.state.posts.filter(item => item.id !== id);

this.setState({ posts });



render() {

return (


<h1>React Axios Delete Request Example - HDTuto.com</h1>

<table className="table table-bordered">










{this.state.posts.map((post) => (






<button className="btn btn-danger" onClick={(e) => this.deleteRow(post.id, e)}>Delete</button>










I hope it can help you...

July 4, 2020 | Category : React

Blog Search