c# - previewing what a .NET HttpResponse object will post (obtaining cURL or similar serialised output) -
i not getting response wanting following code:
var multipart = new multipartformdatacontent(); var empty = encoding.ascii.getbytes("\r\n\r\n\r\n"); httpcontent content = new bytearraycontent(empty); content.headers.add("name", "jform[ical_url]"); multipart.add(content); ...[cut brevity]... using (var handler = new httpclienthandler { usecookies = false }) using (var client = new httpclient(handler) { baseaddress = new system.uri("http://icalendar.org") }) { var response = await client.postasync("/validator", multipart);
i know post request (having used firebug's 'copy curl' menu item).
is there way see client.postasync send, or extension serialise multipart variable above can compare curl string successful post?
thank you.
overriding delegating handler has provided of answer, per this answer.
i had not explained class library. tried crowcoders advice, couldn't work, , entire solution contains no webapi or mvc or similar projects, , trying post validation site check unit tests meet spec. briefly looking through stackify prefix docs, think ability handle kind of scenario in pipeline, not released yet.
as love know if defaults being added header (accept, language etc), might @ fiddler.
Comments
Post a Comment