Skip to content

Commit 6c001c5

Browse files
committed
bugfix #15
1 parent c3d93f0 commit 6c001c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Wechat/Media.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function news(array $articles)
139139
'articles' => $articles,
140140
);
141141

142-
$response = $this->http->post(self::API_FOREVER_NEWS_UPLOAD, $params);
142+
$response = $this->http->jsonPost(self::API_FOREVER_NEWS_UPLOAD, $params);
143143

144144
return $response['media_id'];
145145
}
@@ -161,7 +161,7 @@ public function updateNews($mediaId, $article, $index = 0)
161161
'articles' => array($article),
162162
);
163163

164-
return $this->http->post(self::API_FOREVER_NEWS_UPDATE, $params);
164+
return $this->http->jsonPost(self::API_FOREVER_NEWS_UPDATE, $params);
165165
}
166166

167167
/**
@@ -173,7 +173,7 @@ public function updateNews($mediaId, $article, $index = 0)
173173
*/
174174
public function delete($mediaId)
175175
{
176-
return $this->http->post(self::API_FOREVER_DELETE, array('media_id' => $mediaId));
176+
return $this->http->jsonPost(self::API_FOREVER_DELETE, array('media_id' => $mediaId));
177177
}
178178

179179
/**
@@ -228,7 +228,7 @@ public function lists($type, $offset = 0, $count = 20)
228228
'count' => min(20, $count),
229229
);
230230

231-
return $this->http->post(self::API_FOREVER_LIST, $params);
231+
return $this->http->jsonPost(self::API_FOREVER_LIST, $params);
232232
}
233233

234234
/**
@@ -245,7 +245,7 @@ public function download($mediaId, $filename = '')
245245
'media_id' => $mediaId,
246246
);
247247

248-
$method = $this->forever ? 'post' : 'get';
248+
$method = $this->forever ? 'jsonPost' : 'get';
249249
$api = $this->forever ? self::API_FOREVER_GET : self::API_TEMPORARY_GET;
250250

251251
$contents = $this->http->{$method}($api, $params);

0 commit comments

Comments
 (0)