---
title: "Get-Http"
---
Executes an HTTP GET, DELETE, or HEAD request against a URL, typically used for RESTful operations.
Get-Http(
[Method: <integer>],
Url: <text>,
[LogResponseBody: <true/false>],
[ErrorStatusCodes: <text>],
[ResponseBody: <text>],
[RequestHeaders: <%(key1: value1, ...)>],
[MaxResponseLength: <integer>],
[ProxyRequest: <true/false>],
[Credentials: <text>],
[UserName: <text>],
[Password: <text>],
[IgnoreSslErrors: <true/false>]
);
This operation may be prefixed with HTTP::, although this is a built-in namespace and isn't really necessary.
| Name | Format | Script Usage | Usage Notes |
|---|---|---|---|
| Method | integer | Method | |
| ☆ URL (default) | text | Url | This argument is required. |
| Log response body | true/false | LogResponseBody | |
| Error status codes | text | ErrorStatusCodes | Comma-separated status codes (or ranges in the form of start:end) that should indicate this action has failed. For example, a value of "401,500:599" will fail on all server errors and also when "HTTP Unauthorized" is returned. The default is 400:599. |
| ⇒ Store response as | text | ResponseBody | |
| Request headers | %(key1: value1, ...) | RequestHeaders | |
| Max response length | integer | MaxResponseLength | |
| Use server in context | true/false | ProxyRequest | When selected, this will proxy the HTTP calls through the server is in context instead of using the server Otter or BuildMaster is installed on. |
| Credentials | text | Credentials | |
| User name | text | UserName | |
| Password | text | Password | |
| Ignore SSL Errors | true/false | IgnoreSslErrors |
# downloads the http://httpbin.org/get page and stores its contents in the
# $ResponseBody variable, failing only on 500 errors
Get-Http http://httpbin.org/get
(
ErrorStatusCodes: 500:599,
ResponseBody => $ResponseBody
);