How to pass headers in axios as secret-key

I am using jsonbin.io and hosted a json data as private bin.
I am calling a axios get request to fetch that data. I have to pass my secret-key in headers as

headers{
secret-key: mysecretkey
}

but axios does not allow key in header as secret-key

const secretKey = process.env.REACT_APP_SECRET_KEY;
const localUrl = process.env.REACT_APP_LOCAL_URL;

const fetchPhotosFlocal = async () => {
  const response = await axios.get(localUrl, {
     headers: {
        secret-key: secretKey,
     },
  });
  console.log(response);   };

secret-key gives error at compile time and “secret-key” can not fetch data what should i do now ?

93 thoughts on “How to pass headers in axios as secret-key”

  1. Interesting blog! Is your theme custom made or did you download it from somewhere?

    A theme like yours with a few simple tweeks would really make my
    blog shine. Please let me know where you got your
    design. Thank you

    Reply
  2. Thank you for the auspicious writeup. It in truth used to be a entertainment account it.
    Glance complex to more delivered agreeable from you!
    However, how could we be in contact?

    Reply
  3. Hey There. I found your blog using msn. This is a really well written article.
    I’ll be sure to bookmark it and come back to read more of your useful info.
    Thanks for the post. I’ll definitely comeback.

    Reply
  4. Wow, fantastic blog format! How lengthy have you been blogging for? you make running a blog look easy. The full glance of your web site is excellent, let alone the content!

    Reply
  5. My brother recommended I would possibly like this blog.

    He was once entirely right. This post actually made my day.
    You can not imagine just how so much time I had spent for this
    info! Thank you!

    Reply
  6. I have been exploring for a little for any high quality articles or weblog
    posts on this sort of space . Exploring in Yahoo I finally stumbled upon this site.
    Reading this info So i’m happy to exhibit
    that I’ve a very good uncanny feeling I came upon just what I needed.
    I such a lot for sure will make certain to don?t omit this website and provides it a glance regularly.

    Reply
  7. I have been browsing online more than three hours today, yet I never found any fascinating article like yours.
    It is beautiful worth enough for me. In my view, if all site
    owners and bloggers made excellent content as you did, the net might be much more helpful than ever before.
    quest bars http://j.mp/3C2tkMR quest bars

    Reply
  8. You really make it appear really easy along with your presentation but I in finding this topic to be actually something which I think I’d never understand. It sort of feels too complex and very extensive for me. I’m taking a look ahead in your next put up, I’ll attempt to get the grasp of it!

    Reply
  9. Hey would you mind stating which blog platform you’re working with?
    I’m planning to start my own blog soon but I’m having
    a hard time choosing between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something unique.

    P.S Sorry for being off-topic but I had to ask! scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

    Reply
  10. Hi there! I know this is somewhat off topic but I was wondering which blog platform are you using for this site? I’m getting fed up of WordPress because I’ve had issues with hackers and I’m looking at options for another platform. I would be awesome if you could point me in the direction of a good platform.

    Reply
  11. Have you ever thought about including a little bit more than just your articles? I mean, what you say is valuable and everything. But just imagine if you added some great graphics or videos to give your posts more, “pop”! Your content is excellent but with images and videos, this website could undeniably be one of the greatest in its field. Amazing blog!

    Reply
  12. Hey just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Safari. I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know. The style and design look great though! Hope you get the problem fixed soon. Cheers

    Reply
  13. Just desire to say your article is as surprising.
    The clarity in your put up is just excellent and i can suppose you are a professional on this subject.
    Fine together with your permission allow me to take hold of your feed to keep updated with drawing close
    post. Thank you 1,000,000 and please carry on the gratifying work.

    Reply
  14. Hello There. I found your blog using msn. This is a very well written article.

    I will make sure to bookmark it and come back to read more of your useful info.
    Thanks for the post. I will definitely comeback.

    Reply
  15. Wow, amazing weblog structure! How long have you been running a blog for? you made blogging look easy. The entire look of your website is magnificent, as smartly as the content material!

    Reply
  16. Have you ever considered about adding a little bit more than just your articles? I mean, what you say is valuable and all. But imagine if you added some great images or video clips to give your posts more, “pop”! Your content is excellent but with images and clips, this site could undeniably be one of the best in its niche. Fantastic blog!

    Reply
  17. Appreciating the commitment you put into your blog and detailed information you provide. It’s great to come across a blog every once in a while that isn’t the same old rehashed material. Excellent read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

    Reply

Leave a Comment