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

Send no content-type header if there is no body #2288

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

kkopachev
Copy link
Contributor

Fixes #2287

@kkopachev kkopachev requested a review from a team as a code owner June 29, 2022 20:47
Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down!

@@ -203,7 +203,7 @@ public function call($name, $arguments, $expectedClass = null)
$request = new Request(
$method['httpMethod'],
$url,
['content-type' => 'application/json'],
$postBody ? ['content-type' => 'application/json'] : [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it doesn't make sense to send this in if there's no post body.

@bshaffer bshaffer merged commit 654c0e2 into googleapis:main Jul 18, 2022
@kkopachev kkopachev deleted the no-content-type branch July 18, 2022 22:25
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 this pull request may close these issues.

No-body request to YT api fails with supplied content-type header
2 participants