Pudu programming language
Menu

Std.Http.Server.Route.fieldsOf

1 declaration

fn

fieldsOf: &Std.Http.Server.Route.Request -> Map[Str, Str]

This is a callable function.

What it does

The fields an ordinary form posted.

A form without a file in it is sent as a query string in the body, which is

what every browser does for a `<form method="post">` unless it is told

otherwise. `formOf` reads the other shape — the multipart one a form uses

once it carries a file — and a program that only wants a title and a

checkbox should not have to reach for a parser built for uploads.

The body is read with the same decoder a query string is read with, because

it is the same encoding: `+` is a space, `%41` is an `A`, and a field

written twice keeps the last of them.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • & borrows a value for this call instead of moving or copying it.
  • Names inside [ ] are type arguments, such as the item type held by a collection.

Back to Std.Http.Server.RouteSearch related declarations