Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

post/put/patch methods must specify all headers if present in options passed to method #100

Open
joeldodge79 opened this issue Oct 22, 2020 · 0 comments

Comments

@joeldodge79
Copy link
Contributor

joeldodge79 commented Oct 22, 2020

LookerSDK.client. merge_content_type_if_body fails to delete options[:headers] (as for instance LookerSDK.client.parse_query_and_convenience_headers correctly does) so the caller must supply content_type in order for the call to work.

E.g I'd expect the following to pass both "my-header" and "content_type" headers to the server:

sdk.create_some_resource(
  {resource_name: "foo", an_attr: "bar"},
  {headers: {"my-header" => "something"}},
)

instead it only passes "my-header" and so the caller must do the following to get it to work:

sdk.create_some_resource(
  {resource_name: "foo", an_attr: "bar"},
  {headers: {content_type: "application/json", "my-header" => "something"}},
)
@joeldodge79 joeldodge79 changed the title post/put/patch methods must specify header if options passed to method post/put/patch methods must specify all headers if present in options passed to method Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant