简体   繁体   中英

Web Request to run on client

we have one hardware thing to integrate in our project, the device is acting as the HTTP server. In our local network everything works out great, but problem arised when we put this on live server. Let me explain the reason here with simple code

<form method="LINK" action="http://192.168.0.78:80/XXX/%3C%3Fxml%20version=%221.0%22%20encoding=%22UTF-8%22%3F%3E%3CRequest%3E%3CCallback%3EMirko%3C/Callback%3E%3CAction%3ESCAN%3C/Action%3E%3C/Request%3E">
<input value="Test callback" type="submit">
</form>

As you can see, the form is submitted on my IP where device is connected, so if i put this on my site says xyz.com its working correctly, since its redirect to my local IP

But now i have to integrate this into WebRequest as i cannot go into client response. So if i write

req = (HttpWebRequest)HttpWebRequest.Create("http://192.168.0.78:80/XXX/%3C%3Fxml%20version=%221.0%22%20encoding=%22UTF-8%22%3F%3E%3CRequest%3E%3CCallback%3EMirko%3C/Callback%3E%3CAction%3ESCAN%3C/Action%3E%3C/Request%3E");

Now this not works, obviously because it try to find my IP address in live server..

So is there any other way i can achieve my goal here?

Thanks

我使用HTTPWebRequest来解决问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM