payload to json

This commit is contained in:
Mylloon 2023-05-13 10:40:03 +02:00
parent 047daf36b4
commit 3777bdff1c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 17 additions and 16 deletions

View file

@ -1,23 +1,11 @@
open Pusk.Utils
open Pusk
open Pusk.Net
open Pusk.Drivers
let main =
let json_payload =
{|
{
"capabilities": {
"alwaysMatch": {
"moz:firefoxOptions": {
"args": ["-headless"]
}
}
}
}
|}
in
let body = send_post_request "http://localhost:4444/session" json_payload in
print_endline (Lwt_main.run body)
let body = execute_request "http://localhost:4444/session" Json.connection_payload in
print_endline body
;;
let () =

View file

@ -1,4 +1,4 @@
(library
(name pusk)
(modules utils drivers net)
(modules utils drivers net json)
(libraries cohttp-lwt-unix))

13
lib/json.ml Normal file
View file

@ -0,0 +1,13 @@
let connection_payload =
{|
{
"capabilities": {
"alwaysMatch": {
"moz:firefoxOptions": {
"args": ["-headless"]
}
}
}
}
|}
;;