implemented photo post type

This commit is contained in:
Jeena Paradies 2012-11-24 03:43:11 +01:00
parent 00e1f54636
commit 0786f1cf3f
5 changed files with 64 additions and 17 deletions

View file

@ -20,11 +20,16 @@ function(jQuery, HostApp, Hmac) {
return vars;
}
Paths.getURL = function(url, http_method, callback, data, auth_header) {
Paths.getURL = function(url, http_method, callback, data, auth_header, accepts) {
accepts = accepts || "application/vnd.tent.v0+json";
jQuery.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept", accepts);
if (data) xhr.setRequestHeader("Content-Length", data.length);
if (auth_header) { // if is_set? auth_header
@ -40,7 +45,6 @@ function(jQuery, HostApp, Hmac) {
auth_header = Hmac.makeAuthHeader(
url,
http_method,
//HostApp.stringForKey("user_mac_key"),
HostApp.secret(),
user_access_token
);
@ -49,7 +53,6 @@ function(jQuery, HostApp, Hmac) {
}
},
url: url,
accepts: "application/vnd.tent.v0+json",
contentType: "application/vnd.tent.v0+json",
type: http_method,
complete: callback,
@ -62,8 +65,6 @@ function(jQuery, HostApp, Hmac) {
}
Paths.postMultipart = function(url, callback, data, boundary) {
debug(url)
debug(data)
jQuery.ajax({
@ -79,7 +80,7 @@ function(jQuery, HostApp, Hmac) {
auth_header = Hmac.makeAuthHeader(
url,
"POST",
HostApp.stringForKey("user_mac_key"),
HostApp.secret(),
user_access_token
);
debug(auth_header)