diff options
author | Aaron Parecki <aaron@parecki.com> | 2015-07-25 16:55:13 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2015-07-25 16:55:13 -0700 |
commit | 6c938e9a09771fa31e4e6dedb0e45c01e121d1f3 (patch) | |
tree | d58562ecaeedcb47f537cb1e8b99e7bb5d978794 | |
parent | 5122efff7fd664c70e92e90d82b1a0ac7edb750b (diff) |
send access token in header and post body
closes #4
-rw-r--r-- | lib/helpers.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/helpers.php b/lib/helpers.php index a4dc22e..a85cd89 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -99,8 +99,14 @@ function micropub_post($endpoint, $params, $access_token, $file_path = NULL) { curl_setopt($ch, CURLOPT_URL, $endpoint); curl_setopt($ch, CURLOPT_POST, true); + // Send the access token in both the header and post body to support more clients + // https://github.com/aaronpk/Quill/issues/4 + // http://indiewebcamp.com/irc/2015-02-14#t1423955287064 $httpheaders = array('Authorization: Bearer ' . $access_token); - $params = array_merge(array('h' => 'entry'), $params); + $params = array_merge(array( + 'h' => 'entry', + 'access_token' => $access_token + ), $params); if(!$file_path) { $post = http_build_query($params); |