{"id":28100422,"url":"https://github.com/tidev/apshttpclient","last_synced_at":"2025-05-13T18:34:45.776Z","repository":{"id":16066309,"uuid":"18810634","full_name":"tidev/APSHTTPClient","owner":"tidev","description":"APSHTTPClient (TiHTTPClient)","archived":false,"fork":false,"pushed_at":"2024-03-06T21:41:46.000Z","size":5456,"stargazers_count":4,"open_issues_count":0,"forks_count":19,"subscribers_count":47,"default_branch":"master","last_synced_at":"2024-05-01T11:49:16.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidev.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"tidev","liberapay":"tidev"}},"created_at":"2014-04-15T18:15:12.000Z","updated_at":"2022-04-22T04:10:56.000Z","dependencies_parsed_at":"2022-08-31T11:51:08.081Z","dependency_job_id":null,"html_url":"https://github.com/tidev/APSHTTPClient","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2FAPSHTTPClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2FAPSHTTPClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2FAPSHTTPClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidev%2FAPSHTTPClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidev","download_url":"https://codeload.github.com/tidev/APSHTTPClient/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254003679,"owners_count":21997924,"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":"2025-05-13T18:34:45.192Z","updated_at":"2025-05-13T18:34:45.769Z","avatar_url":"https://github.com/tidev.png","language":"Objective-C","funding_links":["https://github.com/sponsors/tidev","https://liberapay.com/tidev"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/appcelerator/APSHTTPClient.svg?branch=master)](https://travis-ci.org/appcelerator/APSHTTPClient)\n### Requirements\n**MobileCoreServices.framework**\n\n### Components\n**APSHTTPRequest** - Responsible for the http request  \n**NSObject\\\u003cAPSHTTPRequestDelegate\\\u003e** - Responsible for the APSHTTPRequest callbacks  \n**APSHTTPPostForm** - Used to build a post form  \n**APSHTTPResponse** - Holds all the response information from the request  \n**APSHTTPHelper** - Helper class with some handy functions\n\n### GET Request:\n\n```objc\n// in header\n#import \u003cAPSHTTPClient/APSHTTPClient.h\u003e\n\n-(void)sendRequest\n{\n  APSHTTPRequest *request = [[[APSHTTPRequest alloc] init] autorelease];\n  [request setDelegate:self];\n  [request setMethod: @\"GET\"];\n  [request setUrl:[NSURL URLWithString: @\"http://google.com/\"]];\n  [request send];\n}\n\n- (void)request:(APSHTTPRequest *)request onLoad:(APSHTTPResponse *)response\n{\n  NSString* responseString = [response responseString];\n}\n\n- (void)request:(APSHTTPRequest *)request onError:(APSHTTPResponse *)response\n{\n  NSString* errorMessage = [[response error] localizedDescription];\n}\n```\n\n### POST Request:\n\n```objc\n// in header\n#import \u003cAPSHTTPClient/APSHTTPClient.h\u003e\n\n-(void)sendRequest\n{\n  APSHTTPPostForm *form = [[[APSHTTPPostForm alloc] init] autorelease];\n  [form addFormKey:@\"first_name\" andValue: @\"John\"];\n  [form addFormKey:@\"last_name\" andValue: @\"Smith\"];\n  [form addFormData: UIImageJPEGRepresentation([[self myImageView] image], 0.7)\n           fileName:@\"image.jpeg\"\n\t  fieldName:@\"photo\"];\n\n  APSHTTPRequest *request = [[[APSHTTPRequest alloc] init] autorelease];\n  [request setDelegate:self];\n  [request setMethod: @\"POST\"];\n  [request setPostForm:form];\n  [request setUrl:[NSURL URLWithString: @\"http://some_server.com/api/post\"]];\n  [request send];\n}\n\n- (void)request:(APSHTTPRequest *)request onLoad:(APSHTTPResponse *)response\n{\n  NSString* response = [response responseString];\n}\n\n- (void)request:(APSHTTPRequest *)request onError:(APSHTTPResponse *)response\n{\n  NSString* errorMessage = [[response error] localizedDescription];\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fapshttpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidev%2Fapshttpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidev%2Fapshttpclient/lists"}