我在服务器上有 JSON,假设我的 URL 是
https://abc.companyname.com/posts/list/10
当我将该 URL 粘贴到浏览器中时,它会询问我username和password。当我输入这些凭据时,它会返回一些 JSON 格式的数据,如下所示。
[{"id":"5","picture":"myimage.jpg","name":"Usman Zafar","type":"textonly","message":"Woo this is demo and it looks good thanks adeco","image":null,"video_id":null,"datecreated":"2013-10-17 10:14:02","totalLikes":0,"totalComments":0,"commentsData":null},
{"id":"6","picture":"default.jpg","name":"Usman Zafar","type":"textonly","message":"Hello this is the demo of another post but no image","image":null,"video_id":null,"datecreated":"2013-10-17 10:31:04","totalLikes":0,"totalComments":0,"commentsData":null},
{"id":"7","picture":"default.jpg","name":"Usman Zafar","type":"textonly","message":"Hello this is the demo of another post but no image","image":null,"video_id":null,"datecreated":"2013-10-17 10:31:24","totalLikes":0,"totalComments":0,"commentsData":null},
{"id":"11","picture":"myimage_9.jpg","message":"Regukar Text comments no.772"}]}]
我的问题是
如何在 iPhone 编程中使用身份验证(用户名+密码)创建 NSURLConnection?
如果需要有关问题的任何其他数据,请通过评论告诉我。
谢谢