mike/bodyParsers/form

Search:
  Source   Edit

This module implements code for parsing URL encoded form

Types

URLEncodedForm = StringTableRef
  Source   Edit

Procs

proc urlForm(ctx: Context): URLEncodedForm {....raises: [KeyError, ValueError],
    tags: [].}
Get the key values from the form body It is recommended to cache this result instead of calling it for each value. The form parameters are considered case insensitive

Example:

import mike

"/form" -> get:
  let form = ctx.urlForm
  ctx.send form["name"]

"/form" -> post: # Works for POST requests also
  let form = ctx.urlForm
  ctx.send form["name"]
  Source   Edit