gpt4 book ai didi

iphone - 如何打印 NSMutableURLRequest?

转载 作者:IT老高 更新时间:2023-10-28 11:47:46 27 4
gpt4 key购买 nike

如何使用 NSLog 打印 NSMutableURLRequest ?

最佳答案

.allHTTPHeaderFields 返回带有标题内容的字典:

NSLog(@"%@", [request allHTTPHeaderFields]);
// {
// "Accept-Language" = "en;q=1";
// "Content-Length" = 190706;
// "Content-Type" = "multipart/form-data; boundary=Boundary+D90A259975186725";
// "User-Agent" = "...";
// }

或针对特定领域:

NSString *field = @"Content-Type";
NSLog(@"%@",[request valueForHTTPHeaderField:field]);
// multipart/form-data; boundary=Boundary+D90A259975186725

关于iphone - 如何打印 NSMutableURLRequest?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5787010/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com