mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Update documentation with new redirect-to examples
redirect-to now allows for a status_code parameter. This updates the index page and README to reflect that appropriately.
This commit is contained in:
@@ -33,6 +33,7 @@ Endpoint Description
|
||||
`/response-headers`_ Returns given response headers.
|
||||
`/redirect/:n`_ 302 Redirects *n* times.
|
||||
`/redirect-to?url=foo`_ 302 Redirects to the *foo* URL.
|
||||
`/redirect-to?url=foo&status_code=307`_ 307 Redirects to the *foo* URL.
|
||||
`/relative-redirect/:n`_ 302 Relative redirects *n* times.
|
||||
`/cookies`_ Returns cookie data.
|
||||
`/cookies/set?name=value`_ Sets one or more simple cookies.
|
||||
@@ -68,6 +69,8 @@ Endpoint Description
|
||||
.. _/response-headers: http://httpbin.org/response-headers?Content-Type=text/plain;%20charset=UTF-8&Server=httpbin
|
||||
.. _/redirect/:n: http://httpbin.org/redirect/6
|
||||
.. _/redirect-to?url=foo: http://httpbin.org/redirect-to?url=http://example.com/
|
||||
.. _/redirect-to?url=foo&status_code=307:
|
||||
http://httpbin.org/redirect-to?url=http://example.com/&status_code=307
|
||||
.. _/relative-redirect/:n: http://httpbin.org/relative-redirect/6
|
||||
.. _/cookies: http://httpbin.org/cookies
|
||||
.. _/cookies/set?name=value: http://httpbin.org/cookies/set?k1=v1&k2=v2
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<li><a href="{{ url_for('response_headers', **{'Content-Type': 'text/plain; charset=UTF-8', 'Server': 'httpbin'}) }}"><code>/response-headers?key=val</code></a> Returns given response headers.</li>
|
||||
<li><a href="{{ url_for('redirect_n_times', n=6) }}"><code>/redirect/:n</code></a> 302 Redirects <em>n</em> times.</li>
|
||||
<li><a href="{{ url_for('redirect_to', url='http://example.com/') }}"><code>/redirect-to?url=foo</code></a> 302 Redirects to the <em>foo</em> URL.</li>
|
||||
<li><a href="{{ url_for('redirect_to', url='http://example.com/', status_code=307) }}"><code>/redirect-to?url=foo&status_code=307</code></a> 307 Redirects to the <em>foo</em> URL.</li>
|
||||
<li><a href="{{ url_for('relative_redirect_n_times', n=6) }}"><code>/relative-redirect/:n</code></a> 302 Relative redirects <em>n</em> times.</li>
|
||||
<li><a href="{{ url_for('absolute_redirect_n_times', n=6) }}"><code>/absolute-redirect/:n</code></a> 302 Absolute redirects <em>n</em> times.</li>
|
||||
<li><a href="{{ url_for('view_cookies') }}" data-bare-link="true"><code>/cookies</code></a> Returns cookie data.</li>
|
||||
|
||||
Reference in New Issue
Block a user