HTTP Config Requests

Last updated on
23 February 2019

HTTP Config Requests are Configuration Entities which can be used as pre-configured HTTP Calls and can be created for any of your described Guzzle Commands.

Let's see how do they work.

When you have an HTTP Request which uses always the same parameters, instead of:

  1. instantiating the HTTP Client
  2. gathering the parameters
  3. calling the specific Guzzle command
$posts = $this->httpClient->call('FindPosts', [
  'postId' => (int) $id,
]);

you could just create an HTTP Config Request via web UI

and execute it via code by simply:

  1. loading it by name
  2. executing it without passing any parameter to the ::execute() method
$posts = HttpConfigRequest::load('find_post')->execute();

Why that? To avoid redundancy of course. These kind of requests are not dynamic and their configurations can be exported / imported via CMI.

By using HTTP Config Requests, you'll be able to manage static requests in a centralized (via web UI) and versionable (by exporting configurations into files) way.

The HTTP Config Request forms are auto generated by reading from the Service Description of your Guzzle Commands.

I previously said that HTTP Config Requests should be used just for those kind of requests for which parameters should never (or barely) change and... that's not totally true because if you enable Token module, you'd be able to use tokens as parameter values.

Tokens usage is still experimental. If you use tokens please consider that numeric fields could be converted into strings.

Help improve this page

Page status: No known problems

You can: