-
Notifications
You must be signed in to change notification settings - Fork 2
HTTP
dm03514 edited this page Aug 29, 2018
·
2 revisions
$ ./wait-for http --help
NAME:
wait-for http -
USAGE:
wait-for http [command options] [arguments...]
OPTIONS:
--method value, -m value http request method to use for polling (default: "GET")
--url value http uri to poll status of
--body value optional body to send
```
$ ./wait-for http --url=http://google.com/
{"level":"info","msg":"polling","time":"2018-08-26T00:50:39Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":200,"time":"2018-08-26T00:50:40Z"}
$ echo $?
0
```
```
$ ./wait-for -t 500ms http --url=http://www.google.com/1/2
{"level":"info","msg":"polling","time":"2018-08-28T12:43:30Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:30Z"}
{"level":"info","msg":"polling","time":"2018-08-28T12:43:30Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:30Z"}
{"level":"info","msg":"polling","time":"2018-08-28T12:43:30Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:31Z"}
{"level":"info","msg":"polling","time":"2018-08-28T12:43:31Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:31Z"}
{"level":"info","msg":"polling","time":"2018-08-28T12:43:31Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:31Z"}
{"level":"info","msg":"polling","time":"2018-08-28T12:43:31Z"}
{"level":"debug","module":"poller.HTTP","msg":"http_response","status_code":404,"time":"2018-08-28T12:43:31Z"}
{"level":"info","msg":"timeout_reached","time":"2018-08-28T12:43:31Z"}
{"level":"fatal","msg":"timeout reached: 500ms","time":"2018-08-28T12:43:31Z"}
$ echo $?
1
```