Blog
Discord
App →
Search…
What is WayScript?
Quickstart
Building tools
Lairs
File system
Triggers
Events
Endpoints
Deployments
WayScript SDK
Example: identify requester to protected endpoints
Example: send response to http trigger
Environment variables
Testing and Visiblity
Terminal
Processes
Logs
Managing Tools
Alerts
Publishing
Integrations
Collaborating
Workspace
Members
Groups
Hosting
Self-hosting
Resources
Code snippets
Security
Powered By
GitBook
Example: send response to http trigger
Python
1
# Returns json response to http trigger
2
from
wayscript
.
triggers
import
http_trigger
3
4
payload
=
{
"hello"
:
"world"
}
5
headers
=
{
"content-type"
:
"application/json"
}
6
status_code
=
200
7
8
http_trigger
.
send_response
(
data
=
payload
,
headers
=
headers
,
status_code
=
status_code
)
Copied!
JavaScript
1
// Returns json response to http trigger
2
const
wayscript
=
require
(
"wayscript"
);
3
4
let
data
=
{
"hello"
:
"world"
};
5
let
headers
=
{
"content-type"
:
"application/json"
};
6
let
status_code
=
200
;
7
8
wayscript
.
http_trigger
.
sendResponse
(
data
,
headers
,
status_code
);
Copied!
Previous
Example: identify requester to protected endpoints
Next - Building tools
Environment variables
Last modified
2mo ago
Export as PDF
Copy link
Contents
Python
JavaScript