Description
opened on Sep 8, 2023
Consider the following:
import { request, fetch, Agent, Client, setGlobalDispatcher } from './index.js'
setGlobalDispatcher(new Agent({
allowH2: true
}))
// Not working as expected
// the request is done using HTTP/1.1
const res1 = await fetch(`https://http2.pro/api/v1`)
console.log(await res1.json())
// Not working as expected, the response is never received
const client = new Client('https://http2.pro', {
allowH2: true
})
const res2 = await request(`https://http2.pro/api/v1`, { dispatcher: client })
console.log(await res2.body.json())
Activity