diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-04-22 15:26:56 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-04-22 15:26:56 +0000 |
commit | 11e2ea0f044f1f401f808866bf14ec9ad2683695 (patch) | |
tree | 6410e66445c6d287df802faa0bb6ee835c7064dd /yarns.webapp/900-implementations.yarn | |
parent | 5639de7571bc1807e6486c9d05cc455a74346922 (diff) | |
download | lorry-controller-11e2ea0f044f1f401f808866bf14ec9ad2683695.tar.gz |
Provie step to pdo a a body-less POST request
Diffstat (limited to 'yarns.webapp/900-implementations.yarn')
-rw-r--r-- | yarns.webapp/900-implementations.yarn | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/yarns.webapp/900-implementations.yarn b/yarns.webapp/900-implementations.yarn index 859bb40..dba32e1 100644 --- a/yarns.webapp/900-implementations.yarn +++ b/yarns.webapp/900-implementations.yarn @@ -319,23 +319,12 @@ A POST request always has a body. The body consists of `foo=bar` pairs, separated by `&` signs. IMPLEMENTS WHEN (\S+) makes request POST (\S+) with (.*) - > "$DATADIR/response.headers" - > "$DATADIR/response.body" - port=$(cat "$DATADIR/webapp.port") + post_request "$MATCH_2" "$MATCH_3" - # The timestamp is needed by "THEN static status page got updated" - touch "$DATADIR/request.timestamp" +Except, sometimes we don't have a useful body to give. So we don't. - curl \ - -D "$DATADIR/response.headers" \ - -o "$DATADIR/response.body" \ - --silent --show-error \ - --request POST \ - --data "$MATCH_3" \ - "http://127.0.0.1:$port$MATCH_2" - cat "$DATADIR/response.headers" - cat "$DATADIR/response.body" - head -n1 "$DATADIR/response.headers" | grep '^HTTP/1\.[01] 200 ' + IMPLEMENTS WHEN (\S+) makes request POST (\S+) + post_request "$MATCH_2" dummy=value Check the Content-Type of the response has the desired type. |