Maida umarnin CURL zuwa lambar Manufar-C akan layi

Curl command

Examples: GET - POST - JSON - Basic Auth - Files - Form

CURL zuwa Manufar-C akan layi

Wannan kayan aikin yana taimaka muku ƙirƙirar lambar Objective-C bisa umarnin CURL. Kwafi da liƙa umarnin CURL kuma haifar da Manufar-C.

Me zaku iya yi tare da CURL zuwa mai musanya Objective-C akan layi?

  • CURL zuwa Manufar-C kayan aiki ne na musamman don canza umarnin CURL zuwa Buƙatun-C na Manufar-C. Shigar da shigarwar ta hanyar umarnin CURL na mai amfani don samar da lambar Objective-C.
  • Wannan kayan aikin yana adana lokacinku kuma yana taimakawa ƙirƙirar lambar Objective-C cikin sauƙi.
  • CURL zuwa Objective-C yana aiki da kyau akan Windows, MAC, Linux, Chrome, Firefox, Edge da Safari.

menene CURL?

CURL kayan aikin layin umarni ne mai buɗewa wanda ke zazzage fayiloli daga gidan yanar gizo. Yana goyan bayan ka'idoji iri-iri, gami da Objective-C, Objective-CS, FTP, SFTP, TFTP, Gopher da sauransu.

Ta yaya ake canza CURL zuwa lambar Objective-C? 

Mataki 1: Manna kuma canza buƙatun CURL ɗin ku zuwa lambar Objective-C

Mataki 2: Kwafi Manufar-C code

Maida CURL zuwa Misali-C na Ƙa'idar

CURL
curl example.com
Manufar-C
#import <Foundation/Foundation.h>

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com/"]
                                                       cachePolicy:NSURLRequestUseProtocolCachePolicy
                                                   timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
                                            completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                if (error) {
                                                    NSLog(@"%@", error);
                                                } else {
                                                    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
                                                    NSLog(@"%@", httpResponse);
                                                }
                                            }];
[dataTask resume];