1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add API handler to fetch user by username

This commit is contained in:
Frédéric Guillot 2017-12-26 12:10:48 -08:00
parent d5b8f2fb88
commit c3c27e3637
6 changed files with 115 additions and 23 deletions

View file

@ -55,6 +55,10 @@ func (r *request) Delete(path string) (io.ReadCloser, error) {
}
func (r *request) execute(method, path string, data interface{}) (io.ReadCloser, error) {
if r.endpoint[len(r.endpoint)-1:] == "/" {
r.endpoint = r.endpoint[:len(r.endpoint)-1]
}
u, err := url.Parse(r.endpoint + path)
if err != nil {
return nil, err
@ -126,11 +130,3 @@ func (r *request) toJSON(v interface{}) []byte {
return b
}
func newRequest(endpoint, username, password string) *request {
return &request{
endpoint: endpoint,
username: username,
password: password,
}
}