Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've always wondered how to correctly use the "UploadString" method in C#.. I'm working a bit on PHP programming, but so far I'm quite the noob of it. I assume you'd use PHP as the URi. Or wait, maybe UploadString isn't the right one to just upload a string.

Like for instance, creating a chat room - you would need alot of those.

Any feedback on how to use this method would be very appreciated.

share|improve this question
what is it that you want to do? UploadString does a simple post (by default; other verbs are possible) with the string content as the payload body. What do you expect it to do? – Marc Gravell 10 hours ago
I expect it to send a string to a URI – Johan Svensson 10 hours ago
2  
which is what it does - so I'm unclear what usage question you are asking. – Marc Gravell 10 hours ago
I know, and I'd assume that. But what kind of adress would you send it to? – Johan Svensson 6 hours ago
any URL designed to accept that message. There aren't very many rules on what a web-server can and can't do. The URL could be /foo, /foo.aspx, /foo.htm, or /flibble-mc.diddle - the WebClient doesn't care. The real question, perhaps, is what are you trying to do? Many POST routes are designed to accept form data, not a raw post body. But a raw post body is a very useful tool for APIs. – Marc Gravell 6 hours ago

closed as not a real question by David, Clive, Kirk Woll, bensiu, Mario 2 hours ago

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

Browse other questions tagged or ask your own question.