When You’re Making HTTP request in Node.JS Server Written In Node.JS Rest API Frameworks such Express.js, Hapi.js, Fastify.js and Many more, Suddenly, you encounter error “parse Error: Invalid method encountered”, “stack”: Error: Parse Error: Invalid method encountered “bytesParsed”: 0, “code”: “HPE_INVALID_METHOD””, Don’t Panic it’s very not any programming mistake, rather simple typo mistake.
Fix:
What you’re trying to do is, trying to access `https://`
. Go Ahead try it, it will work. instead of
http://
Thanks stackoverflow user for solution Roman.