1
0
Fork 0
mirror of synced 2024-10-02 10:16:27 +13:00

Add body & headers to sync response

This commit is contained in:
Matej Bačo 2023-02-27 13:43:10 +01:00
parent 10ebf6d5fb
commit bf3340a3c6
8 changed files with 19 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1321,6 +1321,7 @@ App::post('/v1/functions/:functionId/executions')
}
$execution->setAttribute('body', $executionResponse['body']);
$execution->setAttribute('headers', $executionResponse['headers']);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)

View file

@ -78,6 +78,18 @@ class Execution extends Model
'default' => 0,
'example' => 200,
])
->addRule('body', [
'type' => self::TYPE_STRING,
'description' => 'HTTP response body. This will return empty unless execution is created as synchronous.',
'default' => '',
'example' => 'Developers are awesome.',
])
->addRule('headers', [
'type' => Response::MODEL_HEADERS,
'description' => 'HTTP response headers as a key-value object. This will return empty unless execution is created as synchronous.',
'default' => new \stdClass(),
'example' => ['x-internal-timezone' => 'UTC'],
])
->addRule('logs', [
'type' => self::TYPE_STRING,
'description' => 'Function logs. Includes the last 4,000 characters. This will return an empty string unless the response is returned using an API key or as part of a webhook payload.',