[_webServer addHandlerForMethod:@"GET" path:@"/111" requestClass:[GCDWebServerRequest class] asyncProcessBlock:^(GCDWebServerRequest *request, GCDWebServerCompletionBlock completionBlock) {
GCDWebServerDataResponse *response = [GCDWebServerDataResponse responseWithJSONObject:@{
@"123":@"123"
}];
completionBlock(response);
}];
I am an iOS developer with ObjC, found GCDWebServer very useful.but I want to simulate for setting my custom request(like json dictionary @{@"name":@"jim",@"age":@"20"}) ? I do not know how, can some one help me ,thx! (support GET/POST)
Aucun commentaire:
Enregistrer un commentaire