{"id":16739451,"url":"https://github.com/williamfalcon/wfhttp","last_synced_at":"2025-03-15T22:43:56.248Z","repository":{"id":15259896,"uuid":"17989005","full_name":"williamFalcon/WFHttp","owner":"williamFalcon","description":"Simple, lightweight HTTP class for iOS","archived":false,"fork":false,"pushed_at":"2015-09-08T03:26:21.000Z","size":276,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T00:02:55.451Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/williamFalcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-21T17:56:23.000Z","updated_at":"2015-01-18T17:01:01.000Z","dependencies_parsed_at":"2022-09-05T13:22:26.947Z","dependency_job_id":null,"html_url":"https://github.com/williamFalcon/WFHttp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamFalcon%2FWFHttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamFalcon%2FWFHttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamFalcon%2FWFHttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/williamFalcon%2FWFHttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/williamFalcon","download_url":"https://codeload.github.com/williamFalcon/WFHttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801611,"owners_count":20350106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T00:51:13.409Z","updated_at":"2025-03-15T22:43:56.227Z","avatar_url":"https://github.com/williamFalcon.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"WFHttp\n======\n\nSimple, lightweight HTTP class for iOS.\n\n## COCOAPODS\n```\npod 'WFHttp'\n```\n\n##SAMPLE USE\n1. GET\n```objective-c\n        [WFHttp GET:@\"http://myUrl.com\" optionalParameters:nil optionalHTTPHeaders:nil completion:^(id result, NSInteger statusCode, NSHTTPURLResponse *response) {\n         \t\n         \t//do stuff with my results\n    \t}];\n```  \n2. POST\n```objective-c\n\t\t[WFHttp POST:@\"http://myUrl.com\" optionalHTTPHeaders:nil object:myObject completion:^(id result, NSInteger statusCode, NSHTTPURLResponse *response) {\n            \n            //do stuff with my results\n    \t}];\n```   \n\n3. PUT (sending an image)\n```objective-c\n\t\tUIImage *selfie = [...]\n\t\tNSDictionary *body = @{@\"user_id\":[User currentUser].id, @\"mySelfie\":selfie};\n\n\t\t[WFHttp PUT:@\"http://myUrl.com\" optionalHTTPHeaders:nil form:body completion:^(id result, NSInteger statusCode, NSHTTPURLResponse *response) {\n         \t//do stuff with my results\n    \t}];\n```   \n\n##METHODS\n```\n+(id)sharedWFHttp;\n```    \n Singleton instance to access manager from anywhere\n\n```\n+(void)GET:(NSString*)url optionalParameters:(NSDictionary *)parameters optionalHTTPHeaders:(NSDictionary *)headers completion:(void(^)(id result, NSInteger statusCode, NSHTTPURLResponse *response))completion\n```   \n Basic GET request. Results return in the completion block\n\n\n```\n+(void)POST:(NSString*)url optionalHTTPHeaders:(NSDictionary *)headers object:(id)object completion:(void(^)(id result, NSInteger statusCode, NSHTTPURLResponse *response))completion\n```   \n Basic POST request. Results return in the completion block.   \n Object can be anything (array, dictionary, NSObject, and more).   \n\n```\n+ (void)PUT:(NSString*)url optionalHTTPHeaders:(NSDictionary *)headers form:(id)form completion:(void(^)(id result, NSInteger statusCode, NSHTTPURLResponse *response))completion\n```   \n Basic PUT request. Results return in the completion block.   \n Object is an NSDictionary that represents a form.    \n Adding an image to the dictionary results in sending the image.   \n Using id as type to be compatible with swift.   \n\n```\n+(void)PUT:(NSString*)url optionalHTTPHeaders:(NSDictionary *)headers object:(id)object completion:(void(^)(id result, NSInteger statusCode, NSHTTPURLResponse *response))completion\n```   \n Basic PUT request. Results return in the completion block.   \n Object can be anything (array, dictionary, NSObject, and more).   \n\n```\n+(void)POSTToQueue:(NSString *)url object:(id)object\n```   \n Create a post request but instead of sending immediately, it adds to a queue to be sent after.   \n the threshold specified.   \n\n\n```\n+(void)sendQueue\n```   \nSends all enqueued requests\n\n\n```\n+(int)postRequestsInQueue\n```   \n Returns the count of requests waiting to be sent\n\n\n```\n-(void)purgeQueue\n```   \n Sends all enqueued requests\n Uses a slightly different implementation to support background mode once\n app has exited\n\n##FEATURES\n\nHttp class wired to perform:\n\n1. GET\n2. POST\n3. Batch POST requests\n\n## BUILT IN DEPENDENCIES\n[Reachability](https://developer.apple.com/Library/ios/samplecode/Reachability/Introduction/Intro.html)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfalcon%2Fwfhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamfalcon%2Fwfhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamfalcon%2Fwfhttp/lists"}