PREQUEST3(1)
π PREQUEST3 β the manual page, but make it cute π
okay so bestie, you opened the manual for prequest3, and it lives in section 1 of the manual β that's User Commands territory, the section for actual runnable programs. it's the Python 3 Pyramid command. let's get into it fr fr β¨
πΈ NAME πΈ
prequest3 β Python 3 Pyramid command. that's it, that's the name, short and iconic π
π¦ DESCRIPTION π¦
okay so here's the whole vibe. the usage looks like this:
usage: prequest3 [-h] [-n NAME] [--header NAME:VALUE] [-d]
[-m {GET,HEAD,POST,PUT,PATCH,DELETE,PROPFIND,OPTIONS}] [-l LOGIN]
[config_uri] [path_info] [config_vars ...]
Submit a HTTP request to a web application. π«Ά
basically this command makes an artificial request to a web application that uses a PasteDeploy (.ini) configuration file β for both the server and the application. it's not hitting a real socket, it's just... manifesting the request directly into the app. main character energy π
here's the little lineup of ways to use it, straight from the source:
- Use
prequest config.ini /pathto request/path. β - Use
prequest --method=POST config.ini /path < datato do a POST with the given request body. - Use
prequest --method=PUT config.ini /path < datato do a PUT with the given request body. - Use
prequest --method=PATCH config.ini /path < datato do a PATCH with the given request body. - Use
prequest --method=OPTIONS config.ini /pathto do an OPTIONS request. - Use
prequest --method=PROPFIND config.ini /pathto do a PROPFIND request.
(yes bestie, every one of those is literally spelled prequest, not prequest3, i don't make the rules, i just report them π)
okay now the path rules, and this part matters so listen up:
- if the path is relative (meaning it doesn't begin with
/) it gets interpreted as relative to/. - the path you pass to this script should be URL-quoted. no cap.
- the path can be succeeded with a query string, like
'/path?a=1&=b2'.
and here's a lil gift for your app: the variable environ['paste.command_request'] will be set to True in the request's WSGI environment. so your application can tell these calls apart from normal requests. it's giving "i have a secret handshake" π€β¨
π positional arguments: π
config_uriβ the URI to the configuration file. this is the whole blueprint, bestie.path_infoβ the path of the request. where you wanna go π£οΈconfig_varsβ variables required by the config file. for example,http_port=%(http_port)swould expecthttp_port=8080to be passed here. it's plugging values into the blanks π§©
π options: π
-h,--helpβ show this help message and exit. the classic escape hatch, always there for you π«Ά-n NAME,--app-name NAMEβ load the named application from the config file (default'main'). so if you've got a different app in there, this is how you call it by name π--header NAME:VALUEβ header to add to request. and the way that you can use this option multiple times?? obsessed. stack those headers π-d,--display-headersβ display status and headers before the response body. so you can see the receipts first π-m {GET,HEAD,POST,PUT,PATCH,DELETE,PROPFIND,OPTIONS},--method {GET,HEAD,POST,PUT,PATCH,DELETE,PROPFIND,OPTIONS}β request method type (GET,POST,PUT,PATCH,DELETE,PROPFIND,OPTIONS). pick your fighter βοΈ-l LOGIN,--login LOGINβ HTTP basic auth username:password pair. theusername:passwordcombo, colon included, don't forget it π
β οΈ quick note bestie: the path really does need to be URL-quoted, and relative paths get resolved against /. that's not me being dramatic, that's just the rules π
and that's the whole page, bestie!! π this was prequest3 version 2.0.2+dfsg-1, dated December 2024. ty for reading, go make some artificial requests, slay β¨πππ¦πΈ
π¦ where this page comes from
- debian trixie: python3-pyramid 2.0.2+dfsg-1 Β· Pyramid
- ubuntu resolute: python3-pyramid 2.0.2+dfsg-1 Β· Pyramid
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms