payload to json
This commit is contained in:
parent
047daf36b4
commit
3777bdff1c
3 changed files with 17 additions and 16 deletions
18
bin/main.ml
18
bin/main.ml
|
@ -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 () =
|
||||
|
|
2
lib/dune
2
lib/dune
|
@ -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
13
lib/json.ml
Normal file
|
@ -0,0 +1,13 @@
|
|||
let connection_payload =
|
||||
{|
|
||||
{
|
||||
"capabilities": {
|
||||
"alwaysMatch": {
|
||||
"moz:firefoxOptions": {
|
||||
"args": ["-headless"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|}
|
||||
;;
|
Loading…
Reference in a new issue