From f9c87b17b5d3ad6113659a30ff76d3a637376fd5 Mon Sep 17 00:00:00 2001 From: tsukino <0xtsukino@gmail.com> Date: Sat, 13 Apr 2024 17:56:59 +0200 Subject: [PATCH] fix: change to post with body and header --- src/tlsn.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tlsn.ts b/src/tlsn.ts index 9fdd7d7..e0f15e4 100644 --- a/src/tlsn.ts +++ b/src/tlsn.ts @@ -109,7 +109,15 @@ export default class TLSN { } async function getSessionId(notaryUrl: string) { - const resp = await fetch(notaryUrl + '/session'); + const resp = await fetch(notaryUrl + '/session', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + clientType: 'Websocket', + }), + }); const json = await resp.json(); return json.session_id; }