Is WebClient the correct Class to be using for this app?

G

Greg

My app needs to make 3 calls to a remote server. 2 contain key value
pairs, and one is a simple ping type call. All 3 are to listen for data
returned in key-value pairs.

Is WebClient.UploadData the correct way to do this? The remote server
doesn't recognise the parameters that I am sending. Is
WebClient.UploadValues an easier way to do the same thing (i.e. makes
packaging of the keys and values more simple)?

Should the ping type call be using a different class altogether?

Greg.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Depend of the remote end, if it;s a web server expecting a http request and
the data in the url you can use webrequest.Create to create it.

Later you have to check the format of the data you receive , just read it in
a stream and dump it in the console.


Please explain further what you mean with "ping type" . IIRC there is not a
Ping class in teh framework
 
G

Greg

Thanks Ignacio.

I've got the 2 calls to the remote server that send data working ok. I
can't test the other one since it hasn't been implemented on the server
yet. By ping type, I meant just that - just a call to an application on
the remote server sending it no data at all, and listening for the
appropropriate response. It doesn't matter what sort of application I'm
calling on the remote server, its the principle that I'm concerned
with.

Thanks again,

Greg.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Greg said:
Thanks Ignacio.

I've got the 2 calls to the remote server that send data working ok. I
can't test the other one since it hasn't been implemented on the server
yet. By ping type, I meant just that - just a call to an application on
the remote server sending it no data at all, and listening for the
appropropriate response. It doesn't matter what sort of application I'm
calling on the remote server, its the principle that I'm concerned
with.

The type of application is of the utter importance, it may be a non http app
and if so you cannot use Httpwebrequest, the Ping ( the real one ) is one
such examples.


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top