How To Use API With Headers?

Hi I need To Get Json Response by using Web Component But At This Time I Need To Use Headers too :frowning:

Without Headers:


But Result should be something like that :

{
  "data": [
    {
      "id": "141981764",
      "login": "twitchdev",
      "display_name": "TwitchDev",
      "type": "",
      "broadcaster_type": "partner",
      "description": "Supporting third-party developers building Twitch integrations from chatbots to game integrations.",
      "profile_image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/8a6381c7-d0c0-4576-b179-38bd5ce1d6af-profile_image-300x300.png",
      "offline_image_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/3f13ab61-ec78-4fe6-8481-8682cb3b0ac2-channel_offline_image-1920x1080.png",
      "view_count": 5980557,
      "email": "[email protected]",
      "created_at": "2016-12-14T20:32:28Z"
    }
  ]
}

---------------------------------------------------------------------------------------------

I Need To GET A request In That way …

curl -X GET 'https://api.twitch.tv/helix/users?id=141981764' \
-H 'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y' \
-H 'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'

I Tried :

But It Returns Nothing !:frowning:

Can Anyone Help Me!

You are setting headers in wrong way.

Try like this,

blocks (12)

6 Likes
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.