asp.net web api - How can I get Wireshark to show me my local HTTP Traffic? -


when enter either uri call rest method on running web api app:

http://shannon2:21608/api/inventory/sendxml/duckbill/platypus/somefilename // using hostname of local machine 

--or one:

http://192.168.125.50:21608/api/inventory/sendxml/duckbill/platypus/somefilename // using ip address of local machine 

...in postman (using httppost, , attaching xml file) , run it, on examining in fiddler 2, see error in fiddler's inspectors.webview pane:

bad request - invalid hostname  --------------------------------------------------------------------------------  http error 400. request hostname invalid. 

note: error though do hit breakpoint in corresponding controller rest method on server.

trying examine further what's happending (what http being sent), run wireshark , see destination of ip address:

enter image description here

...and ip address source:

enter image description here

why there no http protocol entries? http apparently being sent, because hitting breakpoint i've set on first line in server controller method:

[httppost] [route("api/inventory/sendxml/{userid}/{pwd}/{filename}")] public async task sendinventoryxml(string userid, string pwd, string filename) {     task task = request.content.readasstreamasync().continuewith(t =>     {         var stream = t.result;         using (filestream filestream = file.create(string.format(@"c:\hdp\{0}.xml", filename), (int)stream.length))         {             byte[] bytesinstream = new byte[stream.length];             stream.read(bytesinstream, 0, (int)bytesinstream.length);             filestream.write(bytesinstream, 0, bytesinstream.length);         }     }); } 

so why wireshark being secretive showing me http sent? turning blind eye internal communication and, if so, how can "unleash it" show me that?

update

aha / voila! combination of postman, rawcap (http://www.netresec.com/?page=rawcap), , wireshark seems work. promptly ran newly-discovered rawcap command prompt verbiage:

rawcap.exe 192.168.125.50 captured.pcap 

...then called rest method postman, , opened resulting file rawcap created (captured.pcap in case) in wireshark, , shows me http traffic:

enter image description here

some more detail http call can seen here:

enter image description here

what don't know how "shut down" rawcap gracefully.

update 2

rawcap/wireshark tell me it's bad request (which knew response):

enter image description here

...but see nothing give me clue why it's considered bad request

update 3

when try call rest method fiddler composer various forms of "local" (hostname, ip address, "locohost"), never reach breakpoint in server; err msgs prior (404 locohost, 400 others):

enter image description here

typically, invalid hostname means http request's host header contains value not bound site on web server. instance, you're using ip address host, if server configured accept machine name (e.g. mybox) see http/400 server demanding supply proper hostname.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -