nst / STHTTPRequest

Obj-C / Cocoa HTTP requests for humans
BSD 3-Clause "New" or "Revised" License
826 stars 75 forks source link

support for other HTTP methods #10

Closed JoeStrout closed 11 years ago

JoeStrout commented 11 years ago

I'm investigating switching from ASIHTTPRequest to STHTTPRequest for our REST connection. But it appears hat STHTTPRequest offers no control over the HTTP method used (it looks like it's always POST if there's any data attached, and otherwise perhaps GET?).

REST services require use of other methods — in particular, PUT to create a new resource.

How hard would it be to add that as an optional property on STHTTPRequest?

nst commented 11 years ago

It would not be that hard, it just requires much care and testing to be sure not to break anything.

I intend to add support for REST services by adding a HTTPMethod property.

I'll update this issue in a few days when it will be done.

nst commented 11 years ago

I made the following changes https://github.com/nst/STHTTPRequest/commit/6bff40fbf701d27f59519655563fcf74fc0ce4b0 plase let me know it it fulfil your needs

imuhammadjabbar commented 7 years ago

Are other HTTP methods are supported now? For example "PUT"?

nst commented 7 years ago

Yes, use the HTTPMethod property: r.HTTPMethod = @"PUT";