Digging into sending a multipart POST call using flurl to a client's server. Unfortunately, their server is a black box to us. I'm getting a 400 back, with a generic message, so before I bug them, I need to have all my bases covered.
Performing a call like this:
string s = await "https://clientservier.com/cgi-bin/perl-script"
.PostMultipartAsync(mp => mp
.AddString("DisplayActive", "IsDisplayed")
.AddString("ControlTypeHidden", "ALL")
.AddString("QueryHidden", "KEYs")
.AddString("dump_app_trace", "false")
.AddString("db_debug", "false")
.AddString("Get Data", "Get Data"))
.ReceiveString();
If I attach a handler on the BeforeCall event, and look at HttpCall
object, my variables are listed in the Request.Content.Parts
as expected. However, the RequestBody
is null- I'd like to see the string output of the request sent, similar to:
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="DisplayActive"
IsDisplayed
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="ControlTypeHidden"
ALL
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="QueryHidden"
KEYs
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="Get Data"
Get Data
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="dump_app_trace"
false
-----------------------------13377838992432022416720759
Content-Disposition: form-data; name="db_debug"
false
-----------------------------13377838992432022416720759--
(Obviously, yes, the boundary would be different, this is just a browser example.) Interestingly, when the call comes back with the 400, the AfterCall event handler does NOT have the above Parts in the object, so I'm wondering if I'm forgetting to do something before making this call.