# Sending requests to Elasticsearch with axios

**URL:** <https://discuss.elastic.co/t/sending-requests-to-elasticsearch-with-axios/94409>\
**Category:** Elasticsearch\
**Created:** [July 25, 2017, 12:24am UTC](https://discuss.elastic.co/t/sending-requests-to-elasticsearch-with-axios/94409 "2017-07-25T00:24:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhewang](https://avatars.discourse-cdn.com/v4/letter/z/9fc348/32.png) [@zhewang](https://discuss.elastic.co/u/zhewang)\
**Post date:** [July 25, 2017, 12:24am UTC](https://discuss.elastic.co/t/sending-requests-to-elasticsearch-with-axios/94409/1 "2017-07-25T00:24:54Z")

</div>

I'm working on a react app which needs to fetch data from elsaticsearch. In frontend, actually I'm trying to use axios to do the request:

const query = {  
query: {  
match: {  
"\_id": "AV12n5KzsohD5gXzTnOr"  
}  
}  
};

axios.get('[http://localhost:9200/my-index/my-type/\_search](http://localhost:9200/my-index/my-type/_search)', query)  
.then((res) =\> {  
console.log(res);  
});

I want to get the specific document with some ID. The above query actually works inside kibana. However, the above query returns all the documents inside my-type, what am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 22, 2017, 12:25am UTC](https://discuss.elastic.co/t/sending-requests-to-elasticsearch-with-axios/94409/2 "2017-08-22T00:25:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
