Documentation ¶
Overview ¶
Package form enables interactive login without using a web browser.
Index ¶
Constants ¶
const ( // InteractionMethod is the methodURLs key // used for a URL that can be used for form-based // interaction. InteractionMethod = "form" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoginBody ¶
type LoginBody struct {
Form map[string]interface{} `json:"form"`
}
LoginBody holds the body of a form login request.
type LoginRequest ¶
type LoginRequest struct { httprequest.Route `httprequest:"POST"` Body LoginBody `httprequest:",body"` }
LoginRequest is a request to perform a login using the provided form.
type SchemaRequest ¶
type SchemaRequest struct {
httprequest.Route `httprequest:"GET"`
}
SchemaRequest is a request for a form schema.
type SchemaResponse ¶
type SchemaResponse struct {
Schema environschema.Fields `json:"schema"`
}
SchemaResponse contains the message expected in response to the schema request.
type Visitor ¶
type Visitor struct { // Filler holds the form filler that will be used when // form-based interaction is required. Filler form.Filler }
Visitor implements httpbakery.Visitor by providing form-based interaction.
func (Visitor) VisitWebPage ¶
visitWebPage performs the actual visit request. It attempts to determine that form login is supported and then download the form schema. It calls v.handler.Handle using the downloaded schema and then submits the returned form. Any error produced by v.handler.Handle will not have it's cause masked.