Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v74
  • v74
  • v73
  • v72
Login
  • Getting Started
  • Administrator documentation
  • Functional characteristics
  • Technology description
  • System requirements
  • Admin Panel
  • Platform installation
  • Platform configuration
  • Platform maintenance
  • Custom channels guide
    • Overview
    • Creating and configuring a channel
    • Entity field configuration
    • Template language
    • Entities
    • Pipes
      • Pipe: Basic Concepts
      • Result
      • Errors
      • Log
      • Pack
      • Unpack
      • HTTP Request
      • Store Set
      • Store Get
      • Selector
      • SQL
      • Eventer
      • Scheduler
    • Pipelines
  • Extra
  • Processing HTTP/HTTPS traffic
  • Administrator API
  • Custom channels guide
  • Pipes
  • HTTP Request
Documentation for version v74

HTTP Request

Description​

Http request pipe performs an http request.

Peculiarities:

Depending on prams.content_type:

  • form, form-data – data is expected in params.form;
  • xml, json – data is expected in $in.body (must be a byte array).

Structure​

FieldType of valueExampleRequiredDescription
idnumber10yesPipe's ID
typestring"http_request"yesType of a pipe
paramsHttpParamsObject
yesType-specific parameters
outsOutsObject
noPipe's outputs

HttpParamsObject
FiеldTypeExampleRequiredDefaultDescription
content_typestring"json"no"form"

Possible values:

  • form – URL GET parameter
  • form-data – multipart/form-data
  • xml
  • json
methodstringп"POST"no"GET"

Possible values:

  • GET
  • POST
  • DELETE
  • PUT
auth_typestring"basic"no"basic"

Possible values:

  • basic

Will be enabled if specified auth_username.


Requires auth_username and auth_password .


Sets a title Authorization: Basic <username>:<password>

auth_usernamestringа"root"no""Login for basic authorization
auth_passwordstring"1234"no""Password for basic authorization
url

string

"http://exmaple.com/send"no""URL
timeoutтгьиук20тщ

PIPE_HTTP_TIMEOUT


in the configuration file

Timeout in seconds for http request.
success_codesarray of numbers[200, 201]no[200, 201, 202, 203, 204, 205, 206, 207, 208]

An array of http codes, if one of them is present, the event will be sent to outs.success exit.

pool_sizenumber10no

PIPE_HTTP_MAX_CONN


in the configuration file

Limiting the connection pool to one host within a channel.

Increasing pool_size may not bring the desired speed increase without increasing the PIPE_WORKER_SIZE parameter in the configuration file

limitLimitObject

{


   "period_sec": 60,


   "count_requests": 30,


   "key": "some key"


}

no-

Limiting the request rate.

tip

The default request rate depends on the pipeline configuration, but is approximately 200 - 300 requests per second.

headers

object

{


   "someHeader": "value"


}

no-Request headers
form

object

{


   "test": "123"


}

no-

A key:value object that specifies the form for the content_type form and form-data


LimitObject
FiеldTypeExampleRequiredDefaultDescription
period_secnumber1yes-Range in seconds
count_requestsnumber2yes-

The allowed number of requests in the specified time range for the selected key.

The limit is valid within the limits of key in the channel

key

string

"$resource.token"norandom uuid

Constraint ID. Can be a constant or a template.

Needed to set one restriction on several http_request pipes

Errors​

  1. Errors in field template processing.
  2. $in.body not found (missing pack pipe).

  3. $in.body not a byte array.

  4. params.content_type not valid.

  5. params.method not valid.

  6. http request error.

Examples​

  1. Example request with form.
{
"id": 3,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "FORM",
"form": {
"login": "$sender.login",
"password": "$sender.password",
"externalUserCode": "$sender.login"
},
"url": "https://example.com/api/v1.0/sessions",
"success_codes": [200, 202]
},
"outs": {
"success": 6,
"error": 7
}
}
  1. Example request with JSON. It is assumed that in the chain before the pipe there is a pack pipe that generates JSON.
{
"id": 2,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "JSON",
"headers": {
"Authorization": "$in.ow_tp $in.ow_token"
},
"url": "https://example.com/api/v1/api/campaign/start",
"success_codes": [200, 202]
},
"outs": {
"success": 9,
"error": 10
}
}
Last updated on Nov 13, 2023
Previous
Unpack
Next
Store Set
  • Description
  • Structure
  • Errors
  • Examples
© 2015 - 2025 Altcraft, LLC. All rights reserved.