Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2009-05-31 11:41:26 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
951834fafa8221a6eaf79e82f1534411a7e0c694
951834fa
1 parent
5ed9ff30
Added convenience constructors
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
4 deletions
Classes/ASIFormDataRequest.m
Classes/ASIHTTPRequest.h
Classes/ASIHTTPRequest.m
Classes/ASINetworkQueue.h
Classes/ASINetworkQueue.m
Classes/Tests/ASIFormDataRequestTests.m
Classes/Tests/ASIHTTPRequestTests.m
Classes/Tests/ASINetworkQueueTests.m
Classes/ASIFormDataRequest.m
View file @
951834f
...
...
@@ -21,6 +21,11 @@
return
self
;
}
+
(
id
)
requestWithURL
:(
NSURL
*
)
newURL
{
return
[[[
ASIFormDataRequest
alloc
]
initWithURL
:
newURL
]
autorelease
];
}
-
(
void
)
dealloc
{
[
postData
release
];
...
...
Classes/ASIHTTPRequest.h
View file @
951834f
...
...
@@ -222,6 +222,9 @@ extern NSString* const NetworkRequestErrorDomain;
// Should be an HTTP or HTTPS url, may include username and password if appropriate
-
(
id
)
initWithURL
:
(
NSURL
*
)
newURL
;
// Convenience constructor
+
(
id
)
requestWithURL
:(
NSURL
*
)
newURL
;
#pragma mark setup request
// Add a custom header to the request
...
...
Classes/ASIHTTPRequest.m
View file @
951834f
...
...
@@ -104,6 +104,11 @@ static NSError *ASIUnableToCreateRequestError;
return
self
;
}
+
(
id
)
requestWithURL
:
(
NSURL
*
)
newURL
{
return
[[[
ASIHTTPRequest
alloc
]
initWithURL
:
newURL
]
autorelease
];
}
-
(
void
)
dealloc
{
if
(
requestAuthentication
)
{
...
...
Classes/ASINetworkQueue.h
View file @
951834f
...
...
@@ -57,6 +57,9 @@
}
// Convenience constructor
+
(
id
)
queue
;
// Used internally to manage HEAD requests when showAccurateProgress is YES, do not use!
-
(
void
)
addHEADOperation
:(
NSOperation
*
)
operation
;
...
...
Classes/ASINetworkQueue.m
View file @
951834f
...
...
@@ -40,6 +40,11 @@
return
self
;
}
+
(
id
)
queue
{
return
[[[
ASINetworkQueue
alloc
]
init
]
autorelease
];
}
-
(
void
)
dealloc
{
//We need to clear the delegate on any requests that haven't got around to cleaning up yet, as otherwise they'll try to let us know if something goes wrong, and we'll be long gone by then
...
...
Classes/Tests/ASIFormDataRequestTests.m
View file @
951834f
...
...
@@ -21,7 +21,7 @@
NSString
*
path
=
[[[[
NSBundle
mainBundle
]
bundlePath
]
stringByDeletingLastPathComponent
]
stringByAppendingPathComponent
:
@"bigfile"
];
[
data
writeToFile
:
path
atomically
:
NO
];
ASIFormDataRequest
*
request
=
[
[[
ASIFormDataRequest
alloc
]
initWithURL
:
url
]
autorelease
];
ASIFormDataRequest
*
request
=
[
ASIFormDataRequest
requestWithURL
:
url
];
NSDate
*
d
=
[
NSDate
date
];
#if TARGET_OS_IPHONE
...
...
Classes/Tests/ASIHTTPRequestTests.m
View file @
951834f
...
...
@@ -17,8 +17,8 @@
-
(
void
)
testBasicDownload
{
NSURL
*
url
=
[
[[
NSURL
alloc
]
initWithString
:
@"http://allseeing-i.com"
]
autorelease
];
ASIHTTPRequest
*
request
=
[
[[
ASIHTTPRequest
alloc
]
initWithURL
:
url
]
autorelease
];
NSURL
*
url
=
[
NSURL
URLWithString
:
@"http://allseeing-i.com"
];
ASIHTTPRequest
*
request
=
[
ASIHTTPRequest
requestWithURL
:
url
];
[
request
start
];
NSString
*
html
=
[
request
responseString
];
GHAssertNotNil
(
html
,
@"Basic synchronous request failed"
);
...
...
Classes/Tests/ASINetworkQueueTests.m
View file @
951834f
...
...
@@ -19,7 +19,7 @@
complete
=
NO
;
progress
=
0
;
networkQueue
=
[[
ASINetworkQueue
alloc
]
init
];
networkQueue
=
[[
ASINetworkQueue
queue
]
retain
];
[
networkQueue
setDownloadProgressDelegate
:
self
];
[
networkQueue
setDelegate
:
self
];
[
networkQueue
setShowAccurateProgress
:
NO
];
...
...
Please
register
or
login
to post a comment