Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Got http2 http request

node v12.22.12
version: master
endpointsharetweet
const got = require('got'); const {request} = require('http2-wrapper'); const h2got = got.extend({request}); const currentRequestPromise = h2got.post("http://enhcvrwpf7kw6.x.pipedream.net", { headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ query: "Hello" }), protocol: "http:" }) currentRequestPromise .then(({ body, json }) => { console.log({"body": body}) console.log({"json": json}) }) .catch(error => { console.log({"error": error}) })
Loading…

no comments

    sign in to comment