| 123456789101112131415161718192021222324252627 |
- package beaconfire
- import (
- "encoding/json"
- "testing"
- )
- func TestGet(t *testing.T) {
- _, err := Get("http://www.google.com")
- if err != nil {
- t.Error(err)
- }
- }
- func TestPostJson(t *testing.T) {
- body, err := json.Marshal(map[string]string{
- "username": "test",
- "password": "123",
- })
- if err != nil {
- t.Error(err)
- }
- _, err = PostJson("http://google.com", body)
- if err != nil {
- t.Error(err)
- }
- }
|