How can I add `Headers`?
See original GitHub issueI’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:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here you go: https://github.com/dai-shi/react-hooks-fetch/tree/master/examples/05_headers
Thank you!
If I may suggest something, @dai-shi , add an example with
headers
.I’m closing this
issue.