Skip to content
Snippets Groups Projects
Commit 3ba30c17 authored by Lucas García's avatar Lucas García
Browse files

feat: add backend headers schema

parent c86bea0a
No related branches found
No related tags found
1 merge request!3Multi backend plugin
......@@ -8,7 +8,7 @@ require_once 'class-multipart.php';
class Http_Client
{
private static const settings_defaults = [
private const settings_defaults = [
'params' => [],
'data' => [],
'headers' => [
......
......@@ -21,7 +21,13 @@ class Settings extends BaseSettings
'base_url' => ['type' => 'string'],
'headers' => [
'type' => 'array',
'items' => ['type' => 'string'],
'items' => [
'type' => 'object',
'properties' => [
'name' => ['type' => 'string'],
'value' => ['type' => 'string'],
],
],
],
],
],
......@@ -32,7 +38,12 @@ class Settings extends BaseSettings
[
'name' => 'ERP',
'base_url' => 'https://erp.' . $url['host'],
'headers' => ['Authorization: Bearer <backend-api-token>'],
'headers' => [
[
'name' => 'Authorization',
'value' => 'Bearer <backend-api-token>'
]
],
],
],
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment