Browse Source
refactoring code
refactoring code
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@24 282b0af5-e82d-9cf1-ede4-77906d7719d0pull/2/head
chris.lu@gmail.com
13 years ago
7 changed files with 56 additions and 61 deletions
-
56weed-fs/src/cmd/weedc.go
-
5weed-fs/src/pkg/directory/file_id.go
-
1weed-fs/src/pkg/storage/needle.go
-
6weed-fs/src/pkg/storage/needle_map.go
-
3weed-fs/src/pkg/storage/store.go
-
23weed-fs/src/pkg/util/bytes.go
-
23weed-fs/src/pkg/util/post.go
@ -0,0 +1,23 @@ |
|||
package util |
|||
|
|||
import ( |
|||
"http" |
|||
"io/ioutil" |
|||
"url" |
|||
"log" |
|||
) |
|||
|
|||
func Post(url string, values url.Values)[]byte{ |
|||
r, err := http.PostForm(url, values) |
|||
if err != nil { |
|||
log.Println("post:", err) |
|||
return nil |
|||
} |
|||
defer r.Body.Close() |
|||
b, err := ioutil.ReadAll(r.Body) |
|||
if err != nil { |
|||
log.Println("post:", err) |
|||
return nil |
|||
} |
|||
return b |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue