Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
white49
Alamofire
提交
bc6fa4cb
A
Alamofire
项目概览
white49
/
Alamofire
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
Alamofire
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bc6fa4cb
编写于
5月 02, 2015
作者:
M
Mattt Thompson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updating License
上级
0453c07c
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
41 addition
and
27 deletion
+41
-27
Example/AppDelegate.swift
Example/AppDelegate.swift
+2
-1
Example/DetailViewController.swift
Example/DetailViewController.swift
+2
-1
Example/HTTPBin.swift
Example/HTTPBin.swift
+2
-1
Example/MasterViewController.swift
Example/MasterViewController.swift
+2
-1
LICENSE
LICENSE
+1
-1
Source/Alamofire.h
Source/Alamofire.h
+2
-1
Source/Alamofire.swift
Source/Alamofire.swift
+2
-1
Tests/AuthenticationTests.swift
Tests/AuthenticationTests.swift
+2
-1
Tests/DownloadTests.swift
Tests/DownloadTests.swift
+2
-1
Tests/ManagerTests.swift
Tests/ManagerTests.swift
+2
-1
Tests/ParameterEncodingTests.swift
Tests/ParameterEncodingTests.swift
+2
-1
Tests/ResponseTests.swift
Tests/ResponseTests.swift
+14
-13
Tests/TLSEvaluationTests.swift
Tests/TLSEvaluationTests.swift
+2
-1
Tests/UploadTests.swift
Tests/UploadTests.swift
+2
-1
Tests/ValidationTests.swift
Tests/ValidationTests.swift
+2
-1
未找到文件。
Example/AppDelegate.swift
浏览文件 @
bc6fa4cb
// AppDelegate.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
UIKit
@UIApplicationMain
...
...
Example/DetailViewController.swift
浏览文件 @
bc6fa4cb
// DetailViewController.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
UIKit
import
Alamofire
...
...
Example/HTTPBin.swift
浏览文件 @
bc6fa4cb
// MasterViewController.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
...
...
Example/MasterViewController.swift
浏览文件 @
bc6fa4cb
// MasterViewController.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
UIKit
import
Alamofire
...
...
LICENSE
浏览文件 @
bc6fa4cb
Copyright (c) 201
1
–2015 Alamofire Software Foundation (http://alamofire.org/)
Copyright (c) 201
4
–2015 Alamofire Software Foundation (http://alamofire.org/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
Source/Alamofire.h
浏览文件 @
bc6fa4cb
// Alamofire.h
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT
double
AlamofireVersionNumber
;
...
...
Source/Alamofire.swift
浏览文件 @
bc6fa4cb
// Alamofire.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
/// Alamofire errors
...
...
Tests/AuthenticationTests.swift
浏览文件 @
bc6fa4cb
// DownloadTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/DownloadTests.swift
浏览文件 @
bc6fa4cb
// DownloadTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/ManagerTests.swift
浏览文件 @
bc6fa4cb
// RequestTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/ParameterEncodingTests.swift
浏览文件 @
bc6fa4cb
// ParameterEncodingTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/ResponseTests.swift
浏览文件 @
bc6fa4cb
// ResponseTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
@@ -72,14 +73,14 @@ class AlamofireRedirectResponseTestCase: XCTestCase {
func
testGETRequestRedirectResponse
()
{
let
URL
=
"http://google.com"
let
expectation
=
expectationWithDescription
(
"
\(
URL
)
"
)
let
delegate
:
Alamofire
.
Manager
.
SessionDelegate
=
Alamofire
.
Manager
.
sharedInstance
.
delegate
delegate
.
taskWillPerformHTTPRedirection
=
{
(
session
:
NSURLSession
!
,
task
:
NSURLSessionTask
!
,
response
:
NSHTTPURLResponse
!
,
request
:
NSURLRequest
!
)
in
// Accept the redirect by returning the updated request.
return
request
}
Alamofire
.
request
(
.
GET
,
URL
)
.
response
{
(
request
,
response
,
data
,
error
)
in
expectation
.
fulfill
()
...
...
@@ -87,29 +88,29 @@ class AlamofireRedirectResponseTestCase: XCTestCase {
XCTAssertNotNil
(
response
,
"response should not be nil"
)
XCTAssertNotNil
(
data
,
"data should not be nil"
)
XCTAssertNil
(
error
,
"error should be nil"
)
XCTAssertEqual
(
response
!.
URL
!
,
NSURL
(
string
:
"http://www.google.com/"
)
!
,
"request should have followed a redirect"
)
}
waitForExpectationsWithTimeout
(
10
)
{
(
error
)
in
XCTAssertNil
(
error
,
"
\(
error
)
"
)
}
}
func
testGETRequestDisallowRedirectResponse
()
{
let
URL
=
"http://google.com/"
let
expectation
=
expectationWithDescription
(
"
\(
URL
)
"
)
let
delegate
:
Alamofire
.
Manager
.
SessionDelegate
=
Alamofire
.
Manager
.
sharedInstance
.
delegate
delegate
.
taskWillPerformHTTPRedirection
=
{
(
session
:
NSURLSession
!
,
task
:
NSURLSessionTask
!
,
response
:
NSHTTPURLResponse
!
,
request
:
NSURLRequest
!
)
in
// Disallow redirects by returning nil.
// TODO: NSURLSessionDelegate's URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:
// suggests that returning nil should refuse the redirect, but this causes a deadlock/timeout
return
NSURLRequest
(
URL
:
NSURL
(
string
:
URL
)
!
)
}
Alamofire
.
request
(
.
GET
,
URL
)
.
response
{
(
request
,
response
,
data
,
error
)
in
expectation
.
fulfill
()
...
...
@@ -117,10 +118,10 @@ class AlamofireRedirectResponseTestCase: XCTestCase {
XCTAssertNotNil
(
response
,
"response should not be nil"
)
XCTAssertNotNil
(
data
,
"data should not be nil"
)
XCTAssertNil
(
error
,
"error should be nil"
)
XCTAssertEqual
(
response
!.
URL
!
,
NSURL
(
string
:
URL
)
!
,
"request should not have followed a redirect"
)
}
waitForExpectationsWithTimeout
(
10
)
{
(
error
)
in
XCTAssertNil
(
error
,
"
\(
error
)
"
)
}
...
...
Tests/TLSEvaluationTests.swift
浏览文件 @
bc6fa4cb
// DownloadTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/UploadTests.swift
浏览文件 @
bc6fa4cb
// UploadTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
Tests/ValidationTests.swift
浏览文件 @
bc6fa4cb
// DownloadTests.swift
//
// Copyright (c) 2014–2015 Alamofire
(http://alamofire.org
)
// Copyright (c) 2014–2015 Alamofire
Software Foundation (http://alamofire.org/
)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
...
...
@@ -20,6 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import
Foundation
import
Alamofire
import
XCTest
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录