Skip to content

Parsing url encoded form

Ravi Teja Gudapati edited this page Jan 9, 2019 · 8 revisions

Jaguar has built-in support to parse HTTP requests with content type application/x-www-form-urlencoded. bodyAsUrlEncodedForm method on Context object parses the body and returns the form as Map<String, String>.

server.post('/api/contact/add', (ctx) async {
  final Map<String, String> map = await ctx.bodyAsUrlEncodedForm(); // The magic!
  // TODO ...
});

Example projects

  1. form_data
    Example showcasing usage of x-www-form-urlencoded in Jaguar.

What's next?

In the next article, learn how to decode Multipart forms using Jaguar.

Basics

Serialization

Forms

Sessions

Authentication

  • Basic authentication
  • Form authentication
  • JSON authentication
  • Authorization
  • OAuth

Database

Security

Real time

  • Server sent events (SSE)
  • Websockets

Deployment

  • systemd
  • Docker
  • AppEngine

API Documentation

Clone this wiki locally