HTTP helpers module reference

Some useful helpers for HTTP

micro.web.http.redirect(location, code=302)[source]

Issue redirect to given location with a given code.

Parameters:
  • location (str) – The location that will be used for redirect
  • code (int) – The code to use for redirect (default 302)
micro.web.http.header(name, value)[source]

Add the header to response.

Parameters:
  • name – Name of the header to add
  • value – Value of the header to add
micro.web.http.headers()[source]

Get the current response headers multidict instance to perform manipulations on.

Return type:aiohttp.CIMultiDict