when I take out the lines related to httpClient I no longer get this problem... The code works perfectly when compiled using nim c -d:ssl but doesn't work when compiling to js.
Maybe there's some workaround or another package this might achieve this better. I look forward to reading your inputs and ideas.
The code is fairly simple:
import httpclient import json
const link = "https://linktoapi/" const option = "simple option"
var client = newHttpClient()
client.headers = newHttpHeaders({ "Content-Type": "application/json" })
let response = client.request(link & option, httpMethod = HttpGet)
echo(response.status)
let Y = body(response)
let V = parseJson(Y)
echo(V)
simple()
httpclient doesn't support JS backend.
One of solutions is https://github.com/nim-lang/Nim/pull/17373