Hello there, I’m having a problem on my application.
I’ve a webhook to when someone start to stream on twitch.
Then, twitch send me a http
request.
The problem is, that sometimes the data
from the body
of the request sometimes have information and sometimes doesn’t.
Request examples
No information on data
INFO - 2019-08-26 11:21:14 --> array (
'type' => 'post',
'data' =>
stdClass::__set_state(array(
'data' =>
array (
),
)),
'headers' =>
array (
'Content-Type' => 'application/json; charset=utf-8',
'Host' => 'my.domain.com',
'User-Agent' => 'Go-http-client/1.1',
'Connection' => 'close',
'Content-Length' => '11',
'Link' => '; rel="hub", ; rel="self"',
'Twitch-Notification-Id' => '18c3753b-e72c-524b-b0d3-20e60a355f1c',
'Twitch-Notification-Timestamp' => '2019-08-26T14:21:13Z',
'Accept-Encoding' => 'gzip',
),
)
Information on data
INFO - 2019-08-26 11:47:51 --> array (
'type' => 'post',
'data' =>
stdClass::__set_state(array(
'data' =>
array (
0 =>
stdClass::__set_state(array(
'game_id' => '513143',
'id' => '35436702144',
'language' => 'en',
'started_at' => '2019-08-26T13:48:10Z',
'tag_ids' =>
array (
0 => '6ea6bca4-4712-4ab9-a906-e3336a9d8039',
),
'thumbnail_url' => 'https://static-cdn.jtvnw.net/previews-ttv/live_user_mutafuzz-{width}x{height}.jpg',
'title' => '[BR/EN] :ooooo | @mutafuzz1',
'type' => 'live',
'user_id' => '106354514',
'user_name' => 'mutafuzz',
'viewer_count' => 1,
)),
),
)),
'headers' =>
array (
'Content-Type' => 'application/json; charset=utf-8',
'Host' => 'my.domain.com',
'User-Agent' => 'Go-http-client/1.1',
'Connection' => 'close',
'Content-Length' => '367',
'Link' => '; rel="hub", ; rel="self"',
'Twitch-Notification-Id' => '7c66efce-b517-5705-8e4e-ba1346412910',
'Twitch-Notification-Timestamp' => '2019-08-26T14:47:50Z',
'Accept-Encoding' => 'gzip',
),
)
My problem/doubt is, this should happen??