# Callback (rest)

Perform a HTTP request and store response into variable

# Config

rest:

	config:

		# Request
		request:

			# Optional | Type: string | Default: GET
			# HTTP method
			method: "GET"

			# Required | Type: string | Default: null
			# Requested URL
			url: "http://www.goo.gl/?s={$__user->fullname}"

			# Optional | Type: array | Default: []
			# Sent headers
			headers: [foo: "bar"]

			# Auth
			auth:

				# Basic Auth
				basic:

					# Required | Type: string | Default: null
					# Username
					name: "john"

					# Required | Type: string | Default: null
					# Password
					password: "doe"

			# Body
			body:

				# Required | Type: string | Default: RAW
				# Defines how to encode data
				#
				### Note
				### e.g. JSON will encode given request.body.data into JSON string
				type: "RAW"

				# Optional | Type: mixed | Default: null
				# Data to be sent as request body
				#
				### Note
				### Panel works only with string data, any other data must be encoded with option type: JSON
				#
				### Examples
				### - Data is string and type options is RAW. This data will not be encoded. It can be any string # data: 'Hello, {$name}, how are you doing?'
				### - Data contains simple data structures. Type option must be JSON. Data will be encoded into json string
				data: "{output(["name" => $username])]"

			# Optional | Type: bool | Default: true
			# Whether SSL configuration should be verified
			#
			### Note
			### Do not turn off, if it's not really necessary. It should be always preferred to discuss that problem with server administrator and update certificates.
			ssl_verify: true

		# Response
		response:

			# Required | Type: string | Default: null
			# Name of variable in which should be response data stored
			#
			### Note
			### Fields of variable: code, headers, body, error, error_message
			output: "myvar"

			# Optional | Type: string | Default: AUTO
			# Defines how to treat the response data in order to save to variable
			#
			### Note
			### e.g. JSON will expect the response body to be json string and automatically decodes it into
			### multidimensional array and this array is then saved into process variable
			type: "AUTO"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78