Hi,
New to this and need some help...
I’m struggling with converting Python code to C#, I have this line in the Python code and I’m not sure how to implement it in C#:
self.httpServ.request('GET', '/loadinst.cgi'%cmd_type, "<EEX Ver='1.0'><CMD type=%s /></EEX>" % cmd)
Wireshark looks like this:
Hypertext Transfer Protocol
GET /loadinst.cgi HTTP/1.1\r\n
Host: xxx.xxx.xxx.148\r\n
Accept-Encoding: identity\r\n
Content-Length: 119\r\n
\r\n
[Full request URI: http://xxx.xxx.xxx.148/loadinst.cgi]
[HTTP request 1/1]
[Response in frame: 30]
File Data: 119 bytes
Data
[Length: 119]
<EEX Ver='1.0'><CMD type='loadinst' DriverStatusCode='0' emAdapterType='EEXp' id='0' instrumentType='' ipSA='' /></EEX>
My C# implementation is:
var URL1 = (URL + cmd);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL1);
request.Method = "GET";
WebResponse response = request.GetResponse();
but Wireshark capture like:
GET /loadinst.cgi <EEX Ver='1.0'><CMD ....
Host: xxx.xxx.xxx.148
Accept-Encoding: identity
Data field is empty and the remote instrument drops the connection...
How the get the data correctly with GET method as its working with the Python?
Thanks,
New to this and need some help...
I’m struggling with converting Python code to C#, I have this line in the Python code and I’m not sure how to implement it in C#:
self.httpServ.request('GET', '/loadinst.cgi'%cmd_type, "<EEX Ver='1.0'><CMD type=%s /></EEX>" % cmd)
Wireshark looks like this:
Hypertext Transfer Protocol
GET /loadinst.cgi HTTP/1.1\r\n
Host: xxx.xxx.xxx.148\r\n
Accept-Encoding: identity\r\n
Content-Length: 119\r\n
\r\n
[Full request URI: http://xxx.xxx.xxx.148/loadinst.cgi]
[HTTP request 1/1]
[Response in frame: 30]
File Data: 119 bytes
Data
[Length: 119]
<EEX Ver='1.0'><CMD type='loadinst' DriverStatusCode='0' emAdapterType='EEXp' id='0' instrumentType='' ipSA='' /></EEX>
My C# implementation is:
var URL1 = (URL + cmd);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL1);
request.Method = "GET";
WebResponse response = request.GetResponse();
but Wireshark capture like:
GET /loadinst.cgi <EEX Ver='1.0'><CMD ....
Host: xxx.xxx.xxx.148
Accept-Encoding: identity
Data field is empty and the remote instrument drops the connection...
How the get the data correctly with GET method as its working with the Python?
Thanks,