request_client

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	API_VERSION      = "v20.0"
	BASE_URL         = "graph.facebook.com"
	REQUEST_PROTOCOL = "https"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRequest

type ApiRequest struct {
	Path        string
	Method      string
	Body        string
	Fields      []ApiRequestQueryParamField
	QueryParams map[string]string
	Requester   *RequestClient
}

func (*ApiRequest) AddField

func (*ApiRequest) AddQueryParam

func (request *ApiRequest) AddQueryParam(key, value string)

AddQueryParam adds a query parameter to the request.

func (*ApiRequest) Execute

func (request *ApiRequest) Execute() (string, error)

Execute executes the request and returns the response.

func (*ApiRequest) SetBody

func (request *ApiRequest) SetBody(body string)

SetBody sets the body for the request.

func (*ApiRequest) SetMethod

func (request *ApiRequest) SetMethod(method string)

SetMethod sets the method for the request.

type ApiRequestQueryParamField

type ApiRequestQueryParamField struct {
	Name    string
	Filters map[string]string
}

func (*ApiRequestQueryParamField) AddFilter

func (field *ApiRequestQueryParamField) AddFilter(key, value string)

type RequestClient

type RequestClient struct {
	// contains filtered or unexported fields
}

RequestClient represents a client for making requests to a cloud API.

func NewRequestClient

func NewRequestClient(apiAccessToken string) *RequestClient

NewRequestClient creates a new instance of RequestClient.

func (*RequestClient) NewApiRequest

func (client *RequestClient) NewApiRequest(path, method string) *ApiRequest

type RequestCloudApiParams

type RequestCloudApiParams struct {
	Body       string
	Path       string
	Method     string
	QueryParam map[string]string
}

RequestCloudApiParams represents the parameters for making a request to the cloud API.

type WhatsappApiType

type WhatsappApiType string
const (
	WhatsappApiTypeMessaging WhatsappApiType = "messaging"
	WhatsappApiTypeBusiness  WhatsappApiType = "business"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL