This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func postUrls(urls chan string) { | |
for url := range urls { | |
n := NewUrl{url} | |
data, _ := json.Marshal(n) | |
post: | |
resp, err := http.Post(*ginger, "application/json", bytes.NewReader(data)) | |
if err != nil { | |
log.Fatal("post error: ", err) | |
} else if resp.StatusCode == http.StatusCreated { | |
log.Println("added ", url) |