const { https } = require( 'follow-redirects' );
const url = require( 'url' );

const DEFAULT_SSL_PORT = 443;
const ACCEPTABLE_RESPONSE_STATUSCODE = 200;

module.exports = function loadPage ( pageUrl ) {
    return new Promise( ( resolve, reject ) => {
        const parsedUrl = url.parse( pageUrl );
        const options = {
            headers: {
                'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36',
            },
            hostname: parsedUrl.hostname,
            path: encodeURI( parsedUrl.path ),
            port: parsedUrl.port || DEFAULT_SSL_PORT,
            protocol: parsedUrl.protocol,
        };

        const request = https.get( options, ( response ) => {
            let body = '';

            if ( response.statusCode !== ACCEPTABLE_RESPONSE_STATUSCODE ) {
                reject( new Error( `${ pageUrl } return status code ${ response.statusCode }` ) );

                return false;
            }

            response.setEncoding( 'utf8' );

            response.on( 'data', ( chunk ) => {
                body = `${ body }${ chunk }`;
            } );

            response.on( 'end', () => {
                resolve( body );
            } );

            return true;
        } );

        request.on( 'error', ( error ) => {
            reject( error );
        } );
    } );
};

@@ -192,21 +192,42 @@
  pageUrl
+, requestBody = false
  ) %7B%0A
-
     retu
@@ -259,32 +259,61 @@
 , reject ) =%3E %7B%0A
+        let payload = false;%0A
         const pa
@@ -754,16 +754,420 @@
     %7D;%0A%0A
+        if ( requestBody ) %7B%0A            payload = JSON.stringify( requestBody );%0A%0A            options.headers = Object.assign(%0A                %7B%7D,%0A                options.headers,%0A                %7B%0A                    'Content-Length': Buffer.byteLength( payload ),%0A                    'Content-Type': 'application/json',%0A                %7D%0A            );%0A            options.method = 'POST';%0A        %7D%0A%0A
         
@@ -1188,18 +1188,22 @@
 = https.
-ge
+reques
 t( optio
@@ -1829,24 +1829,24 @@
 t( error );%0A
-
         %7D );
@@ -1845,16 +1845,114 @@
     %7D );
+%0A%0A        if ( payload ) %7B%0A            request.write( payload );%0A        %7D%0A%0A        request.end();
 %0A    %7D )

Allow load to handle POSTs with body