Skip to content

Guzzle fails to send headers and requests to incorrect URL #6

@jarrodbell

Description

@jarrodbell

Using Guzzle 6.3.3, the headers fail to send.

I resolved by using my own Guzzle Client in the constructor like so:

$dbot = new DeployBot($this->settings['deploybot']['key'], $this->settings['deploybot']['user'],
	new Client([
		'base_uri' => "https://" . $this->settings['deploybot']['user'] . ".deploybot.com/api/v1/",
		'headers'  => [
			'X-Api-Token' => $this->settings['deploybot']['key'],
			'Accept'      => 'application/json',
		]
	])
);

Notice use of base_uri instead of base_url and moving the headers up to the root element (no defaults) needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions