POST from a windows Service

  • Thread starter Thread starter davidfahy
  • Start date Start date
D

davidfahy

Hi,
This may be a stupid question but i'm just wondering if it is
possible to do a Http POST from a Windows Service (written in C#)

Thanks in Advance
 
Yes, you will want to use the HttpWebRequest/HttpWebResponse classes in
your service.

Also, you will want to make sure that the service is running under an
account that has the appropriate permissions to access the network. The
LocalService account (which is what a lot of services run under) does not
have this permission.

On top of that, if you are writing a service to perform an action (like
a POST) on a timed interval, don't. Write your task as a console
application and then schedule that to run in Scheduled Tasks at your
interval.

Hope this helps.
 
message | Yes, you will want to use the HttpWebRequest/HttpWebResponse classes in
| your service.
|
| Also, you will want to make sure that the service is running under an
| account that has the appropriate permissions to access the network. The
| LocalService account (which is what a lot of services run under) does not
| have this permission.
|

Sorry, but you got it wrong, the "allowed to access the network" in terms of
windows means access privileges to "network resources" like remote shares,
based on access token checks.
Webservers/services are just using TCP/IP sockets and accessing these do not
require an network access token (or simply put they aren't token based). If
what you say was true, you wouldn't be able to access the network using
sockets from a service account.

Willy.
 
Back
Top