Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node http2 post

     let res = "";
      let postbody = JSON.stringify({
       key: value
      });
      let baseurl = 'baseurl'
      let path = '/any-path'
      const client = http2.connect(baseurl);
      const req = client.request({
       ":method": "POST",
       ":path": path,
       "content-type": "application/json",
       "content-length": Buffer.byteLength(postbody),
      });


      req.on("response", (headers, flags) => {
       for (const name in headers) {
        console.log(`${name}: ${headers[name]}`);
       }

      });
      req.on("data", chunk => {
       res = res + chunk;
      });
      req.on("end", () => {
       client.close();
      });

   req.end(postbody)
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to display words from an array in a box in javascript 
Javascript :: accesing jest from bin 
Javascript :: convert a signed 64.64 bit fixed point number online 
Javascript :: create uuid to exist node neo4j 
Javascript :: make file from array save js 
Javascript :: open file method in node js 
Javascript :: create 2d array in javascript filled with 0 
Javascript :: test each jest 
Javascript :: react usestate 
Javascript :: javascript traversing 
Javascript :: for of and for in javascript 
Javascript :: gettwofactorauthenticationuserasync returns null 
Javascript :: js remove all children 
Javascript :: TypeError: fxn.call is not a function 
Javascript :: lunix increae ram available to nodejs 
Javascript :: JavaScript do...while Loop 
Javascript :: how to delete an element from an array 
Javascript :: js how to get element csswidth 
Javascript :: require cycle disable warning react native 
Javascript :: discord.js v13 joinVoiceChannel 
Javascript :: node js error 
Javascript :: all react navigation packages 
Javascript :: hash_hmac javascript 
Javascript :: itsycal homebrew 
Javascript :: javascript delete object from array 
Javascript :: present value formula js 
Javascript :: how to give default value in jquery 
Javascript :: javascript match against array 
Javascript :: crontab validate regex 
Javascript :: javascript code to test if screen is idle 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =