ZF2-145: Zend\GData\Youtube throws an Exception

Description

Hi,

When I want get a VideoEntry of YouTube:

$youtube = new \Zend\GData\YouTube(); $videoEntry = $youtube->getVideoEntry('6GXdJh8nNyk');

An Exception is thrown:

500 Internal Server Error - InvalidArgumentException A field name was provided without a field value In the file Zend/Http/Headers.php

Comments

Could you please provide the stack trace?

Hi,

I got same problem with \Zend\GData\Docs();

$docs = new \Zend\GData\Docs($client); $feed = $docs->getDocumentListFeed();

The error is thrown because the default value for $contentType argument in Zend\GData\App::performHttpRequest (line 581) is null, and generates a key-value pair "Content-Type" => null (line 611) for Zend\Http\Header::addHeaderLine method (line 219).

Fatal error: Uncaught exception 'Zend\Http\Exception\InvalidArgumentException' with message 'A field name was provided without a field value' in /home/usuarios/samir/public_html/zf2/library/Zend/Http/Headers.php:219 Stack trace:

0 /home/usuarios/samir/public_html/zf2/library/Zend/Http/Headers.php(190): Zend\Http\Headers->addHeaderLine('Content-Type', NULL)

1 /home/usuarios/samir/public_html/zf2/library/Zend/Http/Client.php(537): Zend\Http\Headers->addHeaders(Array)

2 /home/usuarios/samir/public_html/zf2/library/Zend/GData/App.php(632): Zend\Http\Client->setHeaders(Array)

3 /home/usuarios/samir/public_html/zf2/library/Zend/GData/GData.php(219): Zend\GData\App->performHttpRequest('GET', 'http://docs.goo...', Array, NULL, NULL, NULL)

4 /home/usuarios/samir/public_html/zf2/library/Zend/GData/App.php(861): Zend\GData\GData->performHttpRequest('GET', 'http://docs.goo...', Array)

5 /home/usuarios/samir/public_html/zf2/library/Zend/GData/App.php(752): Zend\GData\App->get('http://docs.goo...', NULL)

6 /home/usuarios/samir/p in /home/usuarios/samir/public_html/zf2/library/Zend/Http/Headers.php on line 219

This should be fixed with pull request #871

Fixed in beta3