Headers in Node Http not working

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js
Domain
api, tooling

Research direction

Reproduce the issue using the JavaScript configuration example and compare the generated Node HTTP request, focusing on why the configured headers become empty. Done means the generated request includes the configured Content-Type header and preserves the expected POST request behavior.

Written by the indexing model from the issue text.

Description

Config Example:

{
    "method": "POST",
    "url": "https://api.z-api.io/instances/SUA_INSTANCIA/token/SEU_TOKEN/send-text",
    "httpVersion": "HTTP/1.1",
    "queryString": [],
    "headers": [
        {
            "name": "Content-Type",
            "value": "application/json"
        }
    ],
    etc..... 

Result:

var http = require("https");

var options = {
 "method": "POST",
 "hostname": "example.com",
 "port": null,
 "path": "/save",
 "headers": {} // headers empty
};

Dominant language
Pug
Stars
411
Forks
52
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Kong/apiembed

All issues in Kong/apiembed

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.