Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
f1412624
Commit
f1412624
authored
May 13, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge generic requestForURL methods.
parent
766988e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
BUYClient.m
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
+2
-10
BUYClient_Internal.h
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient_Internal.h
+0
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient.m
View file @
f1412624
...
...
@@ -591,19 +591,11 @@ NSString *const BUYClientCustomerAccessToken = @"X-Shopify-Customer-Access-Token
-
(
NSURLSessionDataTask
*
)
requestForURL
:
(
NSURL
*
)
url
method
:
(
NSString
*
)
method
object
:
(
id
<
BUYSerializable
>
)
object
completionHandler
:
(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
{
NS
Data
*
data
=
nil
;
NS
MutableURLRequest
*
request
=
[[
NSMutableURLRequest
alloc
]
initWithURL
:
url
]
;
if
(
object
)
{
data
=
[
NSJSONSerialization
dataWithJSONObject
:[
object
jsonDictionaryForCheckout
]
options
:
0
error
:
nil
];
request
.
HTTPBody
=
[
NSJSONSerialization
dataWithJSONObject
:[
object
jsonDictionaryForCheckout
]
options
:
0
error
:
nil
];
}
return
[
self
requestForURL
:
url
method
:
method
body
:
data
completionHandler
:
completionHandler
];
}
-
(
NSURLSessionDataTask
*
)
requestForURL
:
(
NSURL
*
)
url
method
:
(
NSString
*
)
method
body
:
(
NSData
*
)
body
completionHandler
:
(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
{
NSMutableURLRequest
*
request
=
[[
NSMutableURLRequest
alloc
]
initWithURL
:
url
];
request
.
HTTPBody
=
body
;
[
request
addValue
:[
self
authorizationHeader
]
forHTTPHeaderField
:
@"Authorization"
];
[
request
addValue
:
kJSONType
forHTTPHeaderField
:
@"Content-Type"
];
[
request
addValue
:
kJSONType
forHTTPHeaderField
:
@"Accept"
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Data/BUYClient_Internal.h
View file @
f1412624
...
...
@@ -35,7 +35,6 @@ extern NSString *const kShopifyError;
-
(
NSURLSessionDataTask
*
)
putRequestForURL
:(
NSURL
*
)
url
object
:(
id
<
BUYSerializable
>
)
object
completionHandler
:(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
;
-
(
NSURLSessionDataTask
*
)
getRequestForURL
:(
NSURL
*
)
url
completionHandler
:(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
;
-
(
NSURLSessionDataTask
*
)
requestForURL
:(
NSURL
*
)
url
method
:(
NSString
*
)
method
body
:(
NSData
*
)
body
additionalHeaders
:(
NSDictionary
*
)
headers
completionHandler
:(
void
(
^
)(
NSDictionary
*
json
,
NSURLResponse
*
response
,
NSError
*
error
))
completionHandler
;
-
(
NSURLComponents
*
)
URLComponentsForAPIPath
:(
NSString
*
)
apiPath
appendingPath
:(
NSString
*
)
appendingPath
queryItems
:(
NSDictionary
*
)
queryItems
;
-
(
NSError
*
)
errorFromJSON
:(
NSDictionary
*
)
json
response
:(
NSURLResponse
*
)
response
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment