hurl/integration/tests/assert_status_code.html
2020-11-21 17:28:31 +01:00

1 line
1.8 KiB
HTML

<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">201</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is not 200</span></span><span class="line"><span class="comment"># do not run implicit assert of http response version and code</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> not <span class="predicate-type">equals</span> <span class="number">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"></span><span class="line"><span class="comment"># simply check that the status code is OK</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/assert-status-code</span></span></div><div class="response"><span class="line"><span class="version">HTTP/*</span> <span class="status">*</span></span><span class="line section-header">[Asserts]</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">greater-than-or-equal</span> <span class="number">200</span></span><span class="line"><span class="query-type">status</span> <span class="predicate-type">less-than</span> <span class="number">300</span></span></div></div></div>