httpx

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPActivity

func NewHTTPActivity() workflow.Activity

Types

type HTTPActivity

type HTTPActivity struct{}

HTTPActivity can be used to make HTTP requests

func (*HTTPActivity) Execute

func (a *HTTPActivity) Execute(ctx workflow.Context, params HTTPInput) (HTTPOutput, error)

func (*HTTPActivity) Name

func (a *HTTPActivity) Name() string

type HTTPInput

type HTTPInput struct {
	URL             string            `json:"url"`
	Method          string            `json:"method"` // GET, POST, PUT, DELETE, etc.
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`             // JSON string or plain text
	JSONPayload     map[string]any    `json:"json_payload"`     // Alternative to body for JSON
	Timeout         time.Duration     `json:"timeout"`          // 0 uses default of 30s
	FollowRedirects bool              `json:"follow_redirects"` // default true
}

HTTPInput defines the input parameters for the HTTP activity

type HTTPOutput

type HTTPOutput struct {
	StatusCode    int               `json:"status_code"`
	Status        string            `json:"status"`
	Headers       map[string]string `json:"headers"`
	Body          string            `json:"body"`
	JSONResponse  map[string]any    `json:"json_response,omitempty"`
	Success       bool              `json:"success"`
	ContentLength int64             `json:"content_length"`
}

HTTPOutput defines the output of the HTTP activity

Jump to

Keyboard shortcuts

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