Implement GET /posts/{post_id}/files/info endpoint for APIv4 (#5519)
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
80273d0234
Коммит
ace228c4e5
@@ -783,6 +783,16 @@ func (c *Client4) GetFile(fileId string) ([]byte, *Response) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetFileInfosForPost gets all the file info objects attached to a post.
|
||||
func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) {
|
||||
if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil {
|
||||
return nil, &Response{StatusCode: r.StatusCode, Error: err}
|
||||
} else {
|
||||
defer closeBody(r)
|
||||
return FileInfosFromJson(r.Body), BuildResponse(r)
|
||||
}
|
||||
}
|
||||
|
||||
// General Section
|
||||
|
||||
// GetPing will ping the server and to see if it is up and running.
|
||||
|
||||
Ссылка в новой задаче
Block a user