Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

#419 Added PATCH as an HTTP method which will cause the request params to be ... #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MKNetworkKit/MKNetworkEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
* Creates an operation with the given URL path.
* The default headers you specified in your MKNetworkEngine subclass gets added to the headers
* The params dictionary in this method gets attached to the URL as query parameters if the HTTP Method is GET/DELETE
* The params dictionary is attached to the body if the HTTP Method is POST/PUT
* The params dictionary is attached to the body if the HTTP Method is POST/PUT/PATCH
* The HTTP Method is implicitly assumed to be GET
*/
-(MKNetworkOperation*) operationWithPath:(NSString*) path
Expand All @@ -142,7 +142,7 @@
* The ssl option when false changes the URL to http.
* The default headers you specified in your MKNetworkEngine subclass gets added to the headers
* The params dictionary in this method gets attached to the URL as query parameters if the HTTP Method is GET/DELETE
* The params dictionary is attached to the body if the HTTP Method is POST/PUT
* The params dictionary is attached to the body if the HTTP Method is POST/PUT/PATCH
* The previously mentioned methods operationWithPath: and operationWithPath:params: call this internally
*/
-(MKNetworkOperation*) operationWithPath:(NSString*) path
Expand Down Expand Up @@ -182,7 +182,7 @@
* The hostname of the engine is *NOT* prefixed
* The default headers you specified in your MKNetworkEngine subclass gets added to the headers
* The params dictionary in this method gets attached to the URL as query parameters if the HTTP Method is GET/DELETE
* The params dictionary is attached to the body if the HTTP Method is POST/PUT
* The params dictionary is attached to the body if the HTTP Method is POST/PUT/PATCH
* This method can be over-ridden by subclasses to tweak the operation creation mechanism.
* You would typically over-ride this method to create a subclass of MKNetworkOperation (if you have one). After you create it, you should call [super prepareHeaders:operation] to attach any custom headers from super class.
* @seealso
Expand Down
2 changes: 1 addition & 1 deletion MKNetworkKit/MKNetworkOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ - (id)initWithURLString:(NSString *)aURLString
[self.request setHTTPMethod:method];

if (([method isEqualToString:@"POST"] ||
[method isEqualToString:@"PUT"]) && (params && [params count] > 0)) {
[method isEqualToString:@"PUT"] || [method isEqualToString:@"PATCH"]) && (params && [params count] > 0)) {

self.postDataEncoding = MKNKPostDataEncodingTypeURL;
}
Expand Down