Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPActivity ¶
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
Click to show internal directories.
Click to hide internal directories.