-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
HTTP.yml
59 lines (58 loc) · 3.17 KB
/
HTTP.yml
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
-
# Make an HTTP call
# HttplugBundle will be used under the hood: it is an abstraction layer which allows to use different http clients
# based on Symfony configuration
type: http
mode: call
client: acme # The name of a client as configured in Sf config under httplug / clients.
# For info on how to set it up, see the notes below, as well as:
# http://docs.php-http.org/en/latest/integrations/symfony-bundle.html
uri: http://a.web.site/hi/there # You can probably set up the hostname in the client config and only leave the url here
# References will be replaced as long as they are in brackets, eg:
# http://a.web.site/hi/there?param=[reference:my_ref]
body: some-payload # String; optional. References will be resolved as long as they are in brackets
headers: # array; optional. In case you want to send custom headers. NB: these can be set up in the configuration of the client as well
X-something: value # string
method: GET # string; optional. Defaults to GET
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # An attribute to get the value of for the reference.
# Supports: status_code, reason_phrase, protocol_version, body, body_size
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
# *** Setting it up: ***
#
# 1. use Composer to require BOTH php-http/httplug-bundle and one of the http plug implementations, such as eg. php-http/curl-client
# 2. activate in your Kernel class the `Http\HttplugBundle\HttplugBundle` bundle
# 3. define in a configuration file an httplug client, eg:
#
# httplug:
# plugins:
# logger: ~
# clients:
# acme:
# factory: 'httplug.factory.curl'
# plugins:
# - 'httplug.plugin.logger'
# -
# header_defaults:
# headers:
# "X-FOO": bar
# -
# authentication:
# acme_basic:
# type: 'basic'
# username: 'my_username'
# password: 'p4ssw0rd'
# config:
# CURLOPT_SSL_VERIFYHOST: false
#
# 4. you can now use the name of the client you defined in the migration 'http' steps