restman-0.7.7.0: Web request TUI program.
Safe HaskellNone
LanguageGHC2024

UI

Description

Top-level Brick application wiring for RESTman.

mkInitialState builds the initial AppS from the values parsed on the command line. startUI creates the HTTP manager, optionally performs an initial request when a URI is supplied, and hands control to the Brick main loop.

The Brick App record is assembled here; the individual draw, event-handling, and cursor functions live in Lib.

Synopsis

Application entry points

mkInitialState Source #

Arguments

:: Manager

HTTP connection manager

-> String

Initial HTTP method

-> UseDefaultHeaders

How to handle default headers

-> [Header]

Additional or replacement headers

-> Maybe ByteString

Payload or Nothing

-> Maybe Text

URI or Nothing

-> AppS 

Build the initial AppS from command-line arguments and an HTTP manager.

startUI Source #

Arguments

:: String

Initial HTTP method

-> UseDefaultHeaders

how to handle default headers

-> [Header]

additional or replacement headers

-> Maybe ByteString

payload or Nothing

-> Maybe Text

uri or Nothing

-> IO () 

Launch the RESTman TUI.

Creates a new HTTP Manager using robustSettings, builds the initial AppS via mkInitialState, and — if a URI was supplied — fires an initial request before entering the Brick event loop.