Valentin Gomez

Generation

generate functionTue, 03 Jan 2023

post an api rest using cuit value and get an answer

func main() { fmt.Println("start") cuit := "20-25851149-4" apiURL := "https://api.afip.gob.ar/sr-padron/v2/persona/" + cuit req, err := http.NewRequest("GET", apiURL, nil) if err != nil { panic(err.Error()) } client := &http.Client{ Timeout: time.Second * 10, } req.SetBasicAuth("fakeuser", "fakepassword") req.Header.Add("padron-usuario", "fakeuser") req.Header.Add("padron-password", "fakepassword") req.Header.Add("padron-token", "fakeuser") resp, err := client.Do(req) fmt.Println(resp) body, err := ioutil.ReadAll(resp.Body) if err != nil {

Questions about programming?Chat with your personal AI assistant