The http package provides a set of functions and structures for making HTTP requests and handling WebSocket connections. This package is designed to simplify working with HTTP and WebSocket protocols in your Go applications.
SetMetodoStr(value string) error: Set the HTTP request method using a string.
GetMetodoStr() string: Get the HTTP request method as a string.
SetMetodo(value TMethod) error: Set the HTTP request method using an enum.
GetMetodo() TMethod: Get the HTTP request method.
SetAuthorizationType(value AuthorizationType) error: Set the authorization type.
GetAuthorizationType() AuthorizationType: Get the authorization type.
SetUrl(value string) error: Set the URL for the HTTP request.
GetFullURL() (string, error): Get the full URL.
GetUrl() string: Get the URL with query parameters.
completHeader(): Complete the request headers.
completAutorization(req *http.Request) error: Complete the authorization for the request.
Send() (*Response, error): Send the HTTP request and receive the response.
websocketClient() error: Establish a WebSocket connection.
Conectar() error: Connect to a WebSocket server.
IsConect() bool: Check if the WebSocket connection is established.
Desconectar() error: Close the WebSocket connection.
EnviarBinario(messageType int, data []byte) error: Send binary data over WebSocket.
EnviarTexto(messageType int, data string) error: Send text data over WebSocket.
EnviarTextTypeTextMessage(data []byte) error: Send text data with a TextMessage type.
EnviarBinarioTypeBinaryMessage(data []byte) error: Send binary data with a BinaryMessage type.
NewHttp() *THttp: Create a new THttp instance.
This package simplifies making HTTP requests and handling WebSocket connections in your Go applications. It provides methods and structures to configure and send requests, handle responses, and establish WebSocket connections.
For more details, refer to the Go source code in the http package.