New answers tagged http
Ajax and rest are indeed two ways of using HTTP. But you can use both together. HTTP (HyperText Transfer Protocol) is a protocol to send files (and data) from the server to the client. Originally it was intended to send static HTML files from the server to the client when the client's browser requested a (HTML) page. The HTML can contain hypertext links ...
Ah, I see. This sounds like a PUT request would be the way to go, then. Semantically, a PUT request is made when you know the resource URL you're going to hit, and you want to either create or update the resource at that URL. Alternatively, have different endpoints based on whether a user is registering or logging in (which is how most sites do it).
No, but most HTML files aren't that large anyway; the "heavy" parts of the content are the images. It's not about C# or choice of language in general; the HTTP protocol doesn't define any way to make a request for a specific section of an HTML file.
In this particular example, I think most people would choose option 1. And indeed it feels more natural to me too. Buy why? Not sure there's going to be a definitive answer to this, but my guess: because password, the entity, has a relatively straight forward representation as a document; HTTP's raison d'etre is document transfer, after all. It's pretty ...
Semantically, I would consider a password change a POST. Why? You're not updating an entire resource (i.e. a User), but merely a property on that resource, a property that doesn't really have much to do with the resource's characteristics (like their address or hair color), except insofar as said property influences their ability to access the system. ...
Pick a Http library for C. Use it to call on Stack Exchange's public Web API.
Top 50 recent answers are included