pashmak

GET and POST data

You can access to the GET and POSt data using $web.get and $web.post variables. they are dictionary.

For example, if you open /app.pashm?foo=bar&name=parsa, and print content of $web.get:

import @web
web.init()
web.end_headers()

var_dump($web.get)

You will see:

{
    "foo": "bar",
    "name": "parsa"
}

Means you can access the keys like this:

# ...

println $web.get['name']

Also the $web.post is even like $web.get:

# ...

println $web.post['some_key']

(If the request method is not POST, $web.post is a empty dictionary by default).