# Invoke-restmethod: unable to connect to remote server

**URL:** <https://discuss.elastic.co/t/invoke-restmethod-unable-to-connect-to-remote-server/184011>\
**Category:** Elasticsearch\
**Created:** [June 3, 2019, 3:22pm UTC](https://discuss.elastic.co/t/invoke-restmethod-unable-to-connect-to-remote-server/184011 "2019-06-03T15:22:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ap412](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@ap412](https://discuss.elastic.co/u/ap412)\
**Post date:** [June 3, 2019, 3:22pm UTC](https://discuss.elastic.co/t/invoke-restmethod-unable-to-connect-to-remote-server/184011/1 "2019-06-03T15:22:46Z")

</div>

Hi,

I've installed Elasticsearch 7.1.1 using the .msi package. When I open localhost:9200 it gives me " This site can’t be reached **xxx.xxx.xxx.xxx** refused to connect.

I also opened powershell and typed in: "invoke-restmethod [http://localhost:9200](http://localhost:9200)" but gave me this error:

Invoke-WebRequest : Cannot validate argument on parameter 'Uri'. The argument is null or empty. Provide an argument  
that is not null or empty, and then try the command again.  
At line:1 char:24

- Invoke-WebRequest -URI $url -Proxy '[http://localhost:9200](http://localhost:9200)'
- 

```
                   ~~~~

```

  - CategoryInfo : InvalidData: (🙂 [Invoke-WebRequest], ParameterBindingValidationException
  - FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Please advise.

Thanks!

---

<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 1, 2019, 3:22pm UTC](https://discuss.elastic.co/t/invoke-restmethod-unable-to-connect-to-remote-server/184011/2 "2019-07-01T15:22:51Z")

</div>

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