Closed whoiskevinrich closed 5 years ago
This definitely sounds like something Refit supports. Have a look at form posts in the README.
I tried using both the Dictionary and Dynamic Querystring object approaches shown in the readme, without success.
The call is not for a form post, but rather a POST request with a querystring.
Here is the raw(ish) working request from their Scratchpad (with redacted info):
POST /?AWSAccessKeyId=*******
&Action=GetFeedSubmissionList
&Merchant=*******
&MWSAuthToken=*******
&SignatureVersion=2
&Timestamp=*******
&Version=*******
&Signature=*******
&SignatureMethod=HmacSHA256
&FeedProcessingStatusList.Status.1=_SUBMITTED_ HTTP/1.1
Host: mws.amazonservices.com
x-amazon-user-agent: AmazonJavascriptScratchpad/1.0 (Language=Javascript)
Content-Type: text/xml
Also, I should point out, I can make the request just fine using the format of:
[Post("/?Action={GetFeedSubmission}&Merchant={...} ... ")]
But I'd like to leverage the object approach in order to add validation.
Ah I see. Not sure why that doesn't work.
I noticed this, while probing the RequestBuilderImplementation.cs code:
static readonly ISet<HttpMethod> bodylessMethods = new HashSet<HttpMethod>
{
HttpMethod.Get,
HttpMethod.Head
};
The call in question is bodyless, is it possible this is related?
@whoiskevinrich I believe this is now fixed by the latest release: https://github.com/reactiveui/refit/pull/629
I'm attempting to use Refit against the Amazon MWS API, but have one hurdle:
The Amazon MWS API accepts Query Parameters on a POST request for some calls. Here is some AWS Documentation.
From what I can see, Refit will bind this:
but not this:
AWS is a bit screwy in terms of how this works, but is it possible to add dynamic query support for POST requests?