hurl/integration/tests/post_json.html
2021-07-25 11:01:04 +02:00

1 line
3.8 KiB
HTML

<div class="hurl-file"><div class="hurl-entry"><div class="request"><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json</span></span></div><span class="line"></span><span class="line">{<span class="line"> "name": "Bob",</span><span class="line"> "password": "secret",</span><span class="line"> "age": 30,</span><span class="line"> "strict": true,</span><span class="line"> "spacing": "</span><span class="line">",</span><span class="line"> "g_clef": "ƻǿ"</span><span class="line">}</span></span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json-array</span></span></div><span class="line">[1,2,3]</span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json-string</span></span></div><span class="line">"Hello"</span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json-number</span></span></div><span class="line">100</span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json-numbers</span></span></div><span class="line">{<span class="line"> "natural": 100,</span><span class="line"> "negative": -1,</span><span class="line"> "float": "3.333333333333333",</span><span class="line"> "exponent": 100e100</span><span class="line">}</span></span><div class="response"><span class="line"></span><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/post-json-boolean</span></span></div><span class="line">true</span><div class="response"><span class="line"></span><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="comment">#</span></span><span class="line"><span class="comment"># Use variable in your input json</span></span><span class="line"><span class="comment">#</span></span><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/get-name</span></span></div><div class="response"><span class="line"><span class="version">HTTP/1.0</span> <span class="status">200</span></span><span class="line section-header">[Captures]</span><span class="line">name<span>:</span> <span class="query-type">status</span></span></div></div><div class="hurl-entry"><div class="request"><span class="line"></span><span class="line"><span class="method">POST</span> <span class="url">http://localhost:8000/check_name</span></span></div><span class="line"></span><span class="line">{<span class="line"> "name": "{{name}}"</span><span class="line">}</span></span></div></div>