-
I'm experimenting with using smithy to drive a third party API and getting back a 415. The client is constructed like this;
For the sake of completeness, this is a version of the request which works, in a the VSCode REST extensions.
Smithy model is correspondingly simple;
I get this response, which is confusing me. Is smithy attempting to stream it's body or some other wizardry perhaps? Anything obvious I'm missing here?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Nothing obvious at a glance. Could you plug a middleware on the http4s client to print the "curl view" of the request (ask the http4s for instructions) before it's sent, see whether there's any mismatch between a smithy4s-formed request and a handcrafted one, and report back ? |
Beta Was this translation helpful? Give feedback.
-
It's a little hard to help because:
For 1, we could get some help from the http4s middleware (if you use that) to add a RequestLogger so you can tell us what the generated request looks like:
|
Beta Was this translation helpful? Give feedback.
-
Riiiiiiiiiiiiiiiiight. I've figured this out and it's kind of an obvious but (personally massive) gotcha in hindsight. As always - thanks for writing back. Pop quiz - what's wrong here?
Well, I'm going to go out on a limb and say that smithy does all the right things, and adds it's "I'm json" headers. I then come along, trample and replace (including but not limited to the content-type header) your excellent work with the call to Now, because the "GET" requests worked, I got thrown off looking at the middleware ... because I "knew it worked :-("...
And apparently, all is well with the world again... arg. |
Beta Was this translation helpful? Give feedback.
Riiiiiiiiiiiiiiiiight. I've figured this out and it's kind of an obvious but (personally massive) gotcha in hindsight. As always - thanks for writing back.
Pop quiz - what's wrong here?
Well, I'm going to go out on a limb and say that smithy does all the right things, and adds it's "I'm json" headers. I then come along, trample and replace (including but not limited to the content-type header) your excellent work with …