tentacat icon indicating copy to clipboard operation
tentacat copied to clipboard

Add Support for setting headers

Open jgchristopher opened this issue 4 years ago • 6 comments

I specifically wanted to be able to set the "If-None-Match" header using a previously received ETag.

I updated all of the User Event list functions.

jgchristopher avatar Feb 06 '21 20:02 jgchristopher

Coverage Status

Coverage increased (+0.05%) to 92.145% when pulling 47cec7d3d4330a8d42067d6ab38b362c92997467 on jgchristopher:master into 6e4de63dd19ae719f2b59d4f289979a91e3cb5e2 on edgurgel:master.

coveralls avatar Feb 06 '21 20:02 coveralls

Hey thanks for the PR! Will have a look this week! Cheers!

edgurgel avatar Feb 08 '21 21:02 edgurgel

I think the PR looks good for what it does. Would we like to support passing etag as a more generic option so that any Tentacat function could potentially pass etag as an option instead of the raw header? The etag option would ultimately build the appropriate header ?

edgurgel avatar Feb 21 '21 05:02 edgurgel

Sorry, was distracted the last few weeks.

Yes, I can look at implementing more generically in options.

jgchristopher avatar Mar 19 '21 19:03 jgchristopher

I think the PR looks good for what it does. Would we like to support passing etag as a more generic option so that any Tentacat function could potentially pass etag as an option instead of the raw header? The etag option would ultimately build the appropriate header ?

Just so I understand, you are referring to something more like

@spec list_public(Client.t(), binary, Keyword.t) :: Tentacat.response()
Tentacat.Users.Events.list(client, "bastos", [etag: "2a97f8e2fba8b548ae56bce4074f25cc00674f213963d2f8cf579b8a3"])

jgchristopher avatar Mar 20 '21 14:03 jgchristopher

Hi @jgchristopher !

Yeah that's pretty much what I had in mind. These optional arguments can be sent from basically any API call that we need to and it's extensible enough that we don't end up with tons of arguments that are mostly optional?

What do you think?

edgurgel avatar Mar 21 '21 20:03 edgurgel