# Scala:getStatusCode,getResponseBody is not a member of dispatch.Future

**URL:** <https://discuss.elastic.co/t/scala-getstatuscode-getresponsebody-is-not-a-member-of-dispatch-future/20949>\
**Category:** Elasticsearch\
**Created:** [November 26, 2014, 11:02am UTC](https://discuss.elastic.co/t/scala-getstatuscode-getresponsebody-is-not-a-member-of-dispatch-future/20949 "2014-11-26T11:02:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sara\_waheed](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sara\_waheed](https://discuss.elastic.co/u/sara_waheed)\
**Post date:** [November 26, 2014, 11:02am UTC](https://discuss.elastic.co/t/scala-getstatuscode-getresponsebody-is-not-a-member-of-dispatch-future/20949/1 "2014-11-26T11:02:47Z")

</div>

I am following the this tutorial on gitHhub  
[https://github.com/gphat/wabisabi](https://github.com/gphat/wabisabi) Here is the code of EStest.scala

import scala.concurrent.Awaitimport scala.concurrent.duration.\_  
object EStest {val client = new Client("[http://localhost:9200](http://localhost:9200)")  
// Get the cluster's health  
client.health()  
// Create the index  
client.createIndex(name = "foo")  
// Verify the index exists  
client.verifyIndex("foo").getStatusCode // Should be 200!  
// Add a document to the index.  
client.index(  
index = "foo", `type` = "foo", id = Some("foo"),  
data = "{"foo":"bar"}", refresh = true)  
// Fetch that document by it's id.  
client.get("foo", "foo", "foo").getResponseBody  
// Search for all documents.  
client.search("foo", "{"query": { "match\_all": {} }").getResponseBody  
// Validate a query.  
client.validate(index = "foo", query = "{"query": { "match\_all": {} }").getStatusCode // Should be 200  
// Explain a query.  
client.explain(index = "foo", `type` = "foo", id = "foo2", query = "{"query": { "term": { "foo":"bar"} } }")  
// Delete the document.  
client.delete("foo", "foo", "foo")  
// Delete by query, if you prefer  
client.deleteByQuery(Seq("foo"), Seq.empty[String], "{ "match\_all": {} }")  
// Count the matches to a query  
client.count(Seq("foo"), Seq("foo"), "{"query": { "match\_all": {} }").getResponseBody  
// Delete the index  
client.deleteIndex("foo")}

and following errors occurred

[error] /opt/programs/ES/WabisabiDemo/src/main/scala/EStest.scala:14: value getStatusCode is not a member of dispatch.Future[com.ning.http.client.Response][error] client.verifyIndex("foo").getStatusCode // Should be 200![error] ^[error] /opt/programs/ES/WabisabiDemo/src/main/scala/EStest.scala:23: value getResponseBody is not a member of dispatch.Future[com.ning.http.client.Response][error] client.get("foo", "foo", "foo").getResponseBody[error] ^[error] /opt/programs/ES/WabisabiDemo/src/main/scala/EStest.scala:26: value getResponseBody is not a member of dispatch.Future[com.ning.http.client.Response][error] client.search("foo", "{"query": { "match\_all": {} }").getResponseBody[error] ^[error] /opt/programs/ES/WabisabiDemo/src/main/scala/EStest.scala:29: value getStatusCode is not a member of dispatch.Future[com.ning.http.client.Response][error] client.validate(index = "foo", query = "{"query": { "match\_all": {} }").getStatusCode // Should be 200[error] ^[error] /opt/programs/ES/WabisabiDemo/src/main/scala/EStest.scala:41: value getResponseBody is not a member of dispatch.Future[com.ning.http.client.Response][error] client.count(Seq("foo"), Seq("foo"), "{"query": { "match\_all": {} }").getResponseBody[error] ^[error] 5 errors found[error] (compile:compile) Compilation failed[error] Total time: 17 s, completed Nov 26, 2014 1:54:47 PM  
I am not pasting the code of client.scala because it has no errors  
,Please help me how can i resolve this error getResponseBody is not a  
member of dispatch.Future[com.ning.http.client.Response] and same for  
the getStatusCode I am a beginner so i need helpl please help me

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bb4448ee-c0a2-40a0-be7b-cb219bc0f721%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bb4448ee-c0a2-40a0-be7b-cb219bc0f721%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:47am UTC](https://discuss.elastic.co/t/scala-getstatuscode-getresponsebody-is-not-a-member-of-dispatch-future/20949/2 "2017-07-06T00:47:31Z")

</div>

Closed on July 6, 2017, 12:47am UTC


