2011-12-08 37 views
1

我需要登錄ASIHTTP的iOS asihttp的NSLog要求

NSURL *url = [NSURL URLWithString:@"https:// tor.or rd.net.au/OnlineService.svc/JSON/G "]; 

    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; 

    [request setDelegate:self]; 

    [request setPostValue:@"b07db55065b922fdae9" forKey:@"token"]; 
    [request setPostValue:@"2312" forKey:@"points"]; 

    [request startSynchronous]; 
    //hasta aqui! 
    NSString *response = [request responseString]; 

    NSLog(@"the request ::%@", request); 

    NSLog(@"respond ::%@", response); 

使用的要求,但我得到這個在我的NSLog

 the request ::<ASIFormDataRequest: 0x7b62a00> 

我想看到的URL和身體(字典)

所以我如何格式化響應被記錄, 謝謝!

回答

2

我前幾天有同樣的問題。想通了,這裏的解決方案:

轉到ASIHTTPRequestConfig.h文件,尋找線20這將是

// When set to 1, ASIFormDataRequests will print information about the request body to the console 
#ifndef DEBUG_FORM_DATA_REQUEST 
#define DEBUG_FORM_DATA_REQUEST 0 
#endif 

於是登錄請求身體根本改變0到1.因此,這將是像這樣:

// When set to 1, ASIFormDataRequests will print information about the request body to the console 
#ifndef DEBUG_FORM_DATA_REQUEST 
#define DEBUG_FORM_DATA_REQUEST 1 
#endif 

享受。希望它有幫助:)

1

這就是要求。它是指向請求對象的指針的日誌。你還在找什麼?

+0

嗨,謝謝,我想看看指針內容?,URL和正文用字典?,歡呼 – MaKo

+0

檢查下去,其他答案應該是準確的。 – gurooj

3

ASIFormDataRequestASIHTTPRequest一個子類,

看到的網址,使用NSLog(@"the request ::%@", [request originalURL]);