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
Roman Busyghin
2009-04-15 13:12:15 +0400
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
Ben Copsey
2009-04-15 12:21:12 +0100
Commit
331e21fe971c17327e221a8b19107b59dd8c76dd
331e21fe
1 parent
eef8619c
Use Content-Length header only when postLength > 0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequest.m
View file @
331e21f
...
...
@@ -172,9 +172,13 @@ static NSError *ASIUnableToCreateRequestError;
}
else
{
[
self
setPostLength
:[
postBody
length
]];
}
[
self
addRequestHeader
:
@"Content-Length"
value
:[
NSString
stringWithFormat
:
@"%llu"
,
postLength
]];
if
(
postLength
>
0
&&
!
[
requestMethod
isEqualToString
:
@"POST"
]
&&
!
[
requestMethod
isEqualToString
:
@"PUT"
])
{
[
self
setRequestMethod
:
@"POST"
];
if
(
postLength
>
0
)
{
if
(
!
[
requestMethod
isEqualToString
:
@"POST"
]
&&
!
[
requestMethod
isEqualToString
:
@"PUT"
])
{
[
self
setRequestMethod
:
@"POST"
];
}
[
self
addRequestHeader
:
@"Content-Length"
value
:[
NSString
stringWithFormat
:
@"%llu"
,
postLength
]];
}
haveBuiltPostBody
=
YES
;
}
...
...
Please
register
or
login
to post a comment