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.

How can I add `Headers`?

See original GitHub issue

I’m having trouble with CORS and other stuff related to Headers, there’s nothing mentioning it and no example.

Is it possible to add it?

I’ve tried:

const DisplayRemoteData = () => {
  var myHeaders = new Headers({
    'Access-Control-Allow-Origin': '*',
    'Accept':'*/*'
  })
  const { data } = useFetch("http://date.nager.at/api/v1/get/BR/2019",myHeaders;
  console.log(data)
  //if (error) return <Err error={error} />;
  //if (loading) return <Loading />;
  return (
    <span>
        RemoteData:<br/>
      {data}
    </span>
  );
};

I don’t thing it’s working like intended, though.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
trinaldicommented, Jan 29, 2019

That’s simply because the Header object is not displayed with console.table. console.table was a last attempt; The object doesn’t show in any console.

Maybe, that has been changed Haha such a simple solution, nice! May it’s time to update the list.

Updated the example with a different API.

Thank you!
If I may suggest something, @dai-shi , add an example with headers.

I’m closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert a header or footer - Microsoft Support
Select Insert > Header or Footer. · Select one of the built in designs. · Type the text you want in the header...
Read more >
Microsoft Word: How to insert different headers and footers in ...
Next, select the existing header or footer and click the Link to Previous option (as circled below) to break the header or footer...
Read more >
How to Add a Header in Microsoft Word: 12 Steps (with Pictures)
1. Open Microsoft Word. It's a blue app with a white "W" on it. You can also open an existing document by double-clicking it....
Read more >
How to Insert a Custom Header or Footer in Microsoft Word
1. Click the Insert tab. It's at the top of Word. If you've already inserted a header or footer and want to edit it,...
Read more >
Headers.set() - Web APIs - MDN Web Docs - Mozilla
The difference between set() and Headers.append is that if the specified header already exists and accepts multiple values, set() overwrites the ...
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