the above snippet will send request to
https://jsonplaceholder.typicode.com/comments?postId=1 with the given
options.
-- ftd.http-options opts:
redirect: follow
method: POST ;; ONLY THIS IS CHANGED FROM THE ABOVE SNIPPET
fastn-module: test-multiauth
-- void send-req():
ftd.http-options opts: $opts
ftd.http(
"https://jsonplaceholder.typicode.com/comments",
opts,
("postId", 1)
)
the above snippet will send request to
https://jsonplaceholder.typicode.com/comments with request body as
{"postId": 1}.
existing query params are preserved.
if the url already has a query param with the same name, it will be overridden.
Add support for sending GET requests in
ftd.http
. Params are transformed into query string or request body depending upon the type of request.the above snippet will send request to
https://jsonplaceholder.typicode.com/comments?postId=1
with the given options.the above snippet will send request to
https://jsonplaceholder.typicode.com/comments
with request body as{"postId": 1}
.