Valentin Gomez

Generation

generate functionTue, 03 Jan 2023

interact with Ratificacion/Login in https://apiadv.sintia.com.ar/Help/Api/POST-Ratificacion-Login

func login(url string, username string, password string) map[string]interface{} { values := map[string]string{"Usuario": username, "Clave": password} jsonValue, _ := json.Marshal(values) response, err := http.Post(url, "application/json", bytes.NewBuffer(jsonValue)) if err != nil { panic(err) } defer response.Body.Close() bodyBytes, err := ioutil.ReadAll(response.Body) if err != nil { panic(err) } bodyString := string(bodyBytes) fmt.Println(bodyString) var result map[string]interface{} json.Unmarshal(bodyBytes, &result) return result }

Questions about programming?Chat with your personal AI assistant