16

When I execute the elastic search java API using jest client, I face the following error

org.apache.http.client.ClientProtocolException: URI does not specify a valid host name:localhost:9200/index/type/_search

I tries various possibilities to fix this error, but I am stuck. How can I fix this?

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
mohan
  • 359
  • 1
  • 5
  • 18
  • 1
    You're probably just missing `http://` at the beginning but can you show a bit more of the code where you create the Jest client? – Val Oct 01 '15 at 09:30
  • yes unfortunately i missed it after i use http:// it works fine.thanks for ur response. – mohan Oct 01 '15 at 09:54

2 Answers2

49

You just need to add http:// at the beginning of the URI.

Val
  • 207,596
  • 13
  • 358
  • 360
-1

If you are seeing the same error in JMeter while you want to use a response Json key value in another variable(by creating a new HTTP Request) then use JSON Extractor instead of Regular Expression extractor. Thread Group->Right click and Add->Post Processor->JSON Extractor) enter image description here

  • Please provide additional details in your answer. As it's currently written, it's hard to understand your solution. – Community Sep 08 '21 at 09:16