Petras
Petras

Reputation: 4759

What is the simplest way for an app to communicate with a website in asp.net?

I have a desktop application. Users register to use it. When they register, I need to make sure their email address is unique. So I need to send a request to a website that keeps a list of all email addresses and returns the results.

What is the simplest, quickest way to do this is ASP.NET?

I could do this:

Send a webrequest:

http://www.site.com/[email protected]

And the aspx returns xml:

<response>Valid</response>

There are a few other simple tasks like this. There is no need for heavy security or the need to make the system particularly robust due to high demand.

I have used web services before but that seems like too much overhead for this simple task.

Is there an elegant API that wraps up this communication system as it must be very common.

Upvotes: 0

Views: 45

Answers (2)

EnabrenTane
EnabrenTane

Reputation: 7466

HTTP has you covered. Just check the response code from your server.

http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

I suggest you use

409 Conflict
Indicates that the request could not be processed because of conflict in the request

but HTTP 418 is my favorite since I like OpenGL.

Upvotes: 1

Jonathan Wood
Jonathan Wood

Reputation: 67175

Actually, I'd go with something like what you described. It works for me unless you need something else. And I've seen a number of online services work exactly this way.

Upvotes: 0

Related Questions