{"id":22413567,"url":"https://github.com/nextfaze/nfurlconnection","last_synced_at":"2025-03-27T03:28:39.886Z","repository":{"id":2185083,"uuid":"3132645","full_name":"NextFaze/NFURLConnection","owner":"NextFaze","description":"basic framework for sending network requests and parsing responses","archived":false,"fork":false,"pushed_at":"2015-10-30T05:53:59.000Z","size":239,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-02-01T08:48:45.413Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NextFaze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-08T23:07:13.000Z","updated_at":"2014-10-24T06:23:51.000Z","dependencies_parsed_at":"2022-08-19T19:31:14.866Z","dependency_job_id":null,"html_url":"https://github.com/NextFaze/NFURLConnection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2FNFURLConnection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2FNFURLConnection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2FNFURLConnection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2FNFURLConnection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NextFaze","download_url":"https://codeload.github.com/NextFaze/NFURLConnection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245776894,"owners_count":20670431,"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-12-05T14:13:30.038Z","updated_at":"2025-03-27T03:28:39.863Z","avatar_url":"https://github.com/NextFaze.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"NFURLConnection\n===============\n\nNFURLConnection - basic framework for sending network requests and parsing responses\n\nNFURLConnection has a similar architecture to NSURLConnection, but with extra features:\n* an NSOperationQueue to control concurrent network requests, set up dependencies, and priorities etc.\n* constructs query part of url request from given parameters\n* automatically decode XML and JSON responses.\n* automatically encode parameters to a JSON body when sending a non-GET request with a JSON content type.\n* ability to construct multipart form body (including binary data) for POST requests\n* network responses are tied to the original request, so calling code can easily work with multiple concurrent requests.\n\nInstallation\n------------\n\n    \u003e git clone git://github.com/NextFazeSD/NFURLConnction.git\n\nNFURLConnction is a Cocoa Touch Static Library project, and can be incorporated into other xcode projects in the usual ways.\n\nNotes:\n- ensure NFURLConnection is added as Target Dependency\n- ensure libNFURLSConnection.a is added to Link Binary With Libraries\n- in Build Settings, Other Linker Flags, add: -all_load\n\nSynopsis\n--------\n\n    // optionally: define an enumeration of request types\n    typedef enum {\n       RequestType1,    \n       RequestType2,\n       RequestType2\n    } RequestType;\n\n    // create a url connection:\n    NFURLConnection *conn = [[NFURLConnection alloc] init];\n    conn.delegate = self;   // optional\n\nto create a request object    \n\n    NFURLRequest *req = [NFURLRequest requestWithURL:@\"http://www.google.com/\"];\n    req.HTTPMethod = @\"GET\"; \n    req.requestType = RequestType1;   // optionally assign a request type\n    [req setParameterValue:@\"foo\" forKey:@\"bar\"];  // optionally assign parameters\n\nto create a multipart form upload;\nif the request content type is NFURLRequestContentTypeForm (the default) and contains binary parameter data (either as NSData objects or NFURLRequestDataUpload objects), the body of the request will be encoded as multipart form data.\n\n    NSData *imageData = UIImagePNGRepresentation(image);\n    NFURLRequestDataUpload *upload = [NFURLRequestDataUpload dataWithContentType:@\"image/png\" data:imageData];\n    NFURLRequest *req = [NFURLRequest requestWithURL:@\"http://example.com/upload\"];\n    req.HTTPMethod = @\"POST\";\n    [req setParameterValue:imageData forKey:@\"image\"];\n\nto send a request asynchronously\n\n    [conn sendRequest:req];\n\nto send a request synchronously\n\n    NFURLResponse *response = [conn sendSynchronousRequest:req];\n\naccess data structures from the response \n\n    id data = response.object;   // NSArray or NSDictionary if response body is json or xml\n\ndifferentiating responses based on the request\n\n    NSLog(@\"request type is: %d\", response.request.requestType);\n\nWhen using a delegate and asynchronous requests, implement the NFURLConnectionDelegate protocol:\n\n    // delegate method\n    - (void)NFURLConnection:(NFURLConnection *)connection requestCompleted:(NFURLRequest *)request {\n        NFURLResponse *response = request.response;\n        \n        ...\n    }\n\nNetwork Queue\n-------------\n\nThe queue property of NFURLConnection is a NSOperationQueue, and can be accessed to modify the number of concurrent network operations sent by the connection (when sending asynchronous requests).  Each NFURLRequest is a NSOperation, and dependencies can be set up between them in the normal way.\n\nLicense\n-------\nCopyright 2011 NextFaze\nsee also LICENSE.txt\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextfaze%2Fnfurlconnection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextfaze%2Fnfurlconnection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextfaze%2Fnfurlconnection/lists"}