protected function postJSON($url, $data)
    {
        // Try to send the whole lot, or without the meta data for the first
        // event. If failed, try to send the first event, and then the rest of
        // them, recursively. Decrease by a constant and concquer if you like.
        // Note that the base case is satisfied as soon as the payload is small
        // enought to send, or when it's simply discarded.
        try {
            $normalized = $this->normalize($data);
        } catch (RuntimeException $e) {
            if (count($data['events']) > 1) {
                $event = array_shift($data['events']);
                $this->postJSON($url, array_merge($data, ['events' => [$event]]));
                $this->postJSON($url, $data);
            } else {
                error_log('Bugsnag Warning: '.$e->getMessage());
            }

            return;
        }

        // Send via guzzle and log any failures
        try {
            $this->guzzle->post($url, [
                'json' => $normalized,
                'headers' => $this->getHeaders(),
            ]);
        } catch (Exception $e) {
            error_log('Bugsnag Warning: Couldn\'t notify. '.$e->getMessage());
        }
    }
protected function postJSON($url, $data)
    {
        // Try to send the whole lot, or without the meta data for the first
        // event. If failed, try to send the first event, and then the rest of
        // them, recursively. Decrease by a constant and concquer if you like.
        // Note that the base case is satisfied as soon as the payload is small
        // enought to send, or when it's simply discarded.
        try {
            $normalized = $this->normalize($data);
        } catch (RuntimeException $e) {
            if (count($data['events']) > 1) {
                $event = array_shift($data['events']);
                $this->postJSON($url, array_merge($data, ['events' => [$event]]));
                $this->postJSON($url, $data);
            } else {
                error_log('Bugsnag Warning: '.$e->getMessage());
            }

            return;
        }

        // Send via guzzle and log any failures
        try {
            $this->guzzle->post($url, [
                'json' => $normalized,
                'headers' => $this->getHeaders(),
            ]);
        } catch (Exception $e) {
            error_log('Bugsnag Warning: Couldn\'t notify. '.$e->getMessage());
        }
    }
protected function postJSON ( $ url , $ data ) { // Try to send the whole lot, or without the meta data for the first // event. If failed, try to send the first event, and then the rest of // them, recursively. Decrease by a constant and concquer if you like. // Note that the base case is satisfied as soon as the payload is small // enought to send, or when it's simply discarded. try { $ normalized = $ this -> normalize ( $ data ) ; } catch ( RuntimeException $ e ) { if ( count ( $ data [ 'events' ] ) > 1 ) { $ event = array_shift ( $ data [ 'events' ] ) ; $ this -> postJSON ( $ url , array_merge ( $ data , [ 'events' => [ $ event ] ] ) ) ; $ this -> postJSON ( $ url , $ data ) ; } else { error_log ( 'Bugsnag Warning: ' . $ e -> getMessage ( ) ) ; } return ; } // Send via guzzle and log any failures try { $ this -> guzzle -> post ( $ url , [ 'json' => $ normalized , 'headers' => $ this -> getHeaders ( ) , ] ) ; } catch ( Exception $ e ) { error_log ( 'Bugsnag Warning: Couldn\'t notify. ' . $ e -> getMessage ( ) ) ; } }
Post the given data to Bugsnag in json form.

@param string $url  the url to hit
@param array  $data the data send

@return void
Post the given data to Bugsnag in json form .