Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not extract headers if passed as options to Guzzle #25

Open
Einenlum opened this issue Oct 29, 2018 · 0 comments
Open

Does not extract headers if passed as options to Guzzle #25

Einenlum opened this issue Oct 29, 2018 · 0 comments

Comments

@Einenlum
Copy link

Cuzzle formats correctly headers when they are passed to the Request object, but not when passed to the array options of Guzzle. These two pieces of code should return the same value, but they don't.

<?php

use Namshi\Cuzzle\Formatter\CurlFormatter;
use GuzzleHttp\Psr7\Request;

require_once(__DIR__.'/vendor/autoload.php');

// curl 'http://some-url.com/path' -H 'Some-Header: lorem'
echo (new CurlFormatter())->format(
    new Request('get', 'http://some-url.com/path', ['Some-Header' => 'lorem']),
    []
);

// curl 'http://some-url.com/path'
echo (new CurlFormatter())->format(
    new Request('get', 'http://some-url.com/path'),
    ['headers' => ['Some-Header' => 'lorem']]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant