question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request Headers in HTML Reports Not Working

See original GitHub issue
  1. Newman Version (can be found via newman -v): 3.9.3
  2. OS details (type, version, and architecture): Mac OS Sierra 10.12.6
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: First time trying it.
  5. Expected behaviour: I was expecting that I would be able to see the Request headers in the HTML report.
  6. Command / script used to run Newman: Via Jenkins build:
sudo docker run -v $PWD:/etc/newman postman/newman_ubuntu1404:latest \
	run "collections/$testSuite/collection.json" \
    --disable-unicode \
    --color \
    --delay-request 100 \
    --reporters "cli,html" \
    --environment "environments/$environment.json" \
    --reporter-html-export "collections/$testSuite/results/${BUILD_NUMBER}-${testSuite}-${environment}-${gitBranch}-results.html" \
    --reporter-html-template "collections/$testSuite/results/results_template.hbs"

I have noticed that when I modify my results template to include the Request Headers and Request Body that for some reason the Headers are not being populated.

Here is the code that I have added:

<div class="col-md-12">&nbsp;</div>
<br/><div class="col-md-4">Request Headers</div><div class="col-md-8">{{request.headers}}</div><br/>

I have verified that if I do something like console.log(request.headers); in the Postman app that I am seeing the object and values in the console as expected. However in Newman that doesnt seem to be the case. Is this a bug or am I missing something?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ssharmasurender3commented, Dec 28, 2018

I tried {{@key}} but response is

members |   – | – reference |   Type |   _postman_listIndexKey |   _postman_listIndexCaseInsensitive |   _postman_listAllowsMultipleValues

and for {{@value}} blank values.

can you please help @kunagpal

1reaction
azgocommented, Mar 22, 2019

Just adding this for reference and a potential workaround for the issue here:

A different version of the html reporter called htmlextra includes the request and response Headers, for each of the requests in your collections.

https://www.npmjs.com/package/newman-reporter-htmlextra

Yes, I was using htmlextra 1.6.6. and it has this “featurebug”. Took a day for me to check around how others work with request headers/params 😕.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to get report with Response Data_Response ...
i am running jmeter test through non-gui mode and i want to view response data, response header and request header in my Log...
Read more >
Access-Control-Request-Headers - HTTP - MDN Web Docs
The Access-Control-Request-Headers request header is used by browsers when issuing a preflight request to let the server know which HTTP ...
Read more >
HTTP headers | Content-Security-Policy-Report-Only
Examples: The purpose of the header is to report any violations that might have occurred. It can be used iteratively to work upon...
Read more >
HTTP security headers: An easy way to harden your web ...
There are also other HTTP headers that, although not directly related to ... by the browser and server once the web application is...
Read more >
List of HTTP header fields
HTTP header fields are a list of strings sent and received by both the client program and server on every HTTP request and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found