Saturday, October 1, 2022
HomeGolangHow Reply A Google Kinds By means of Code? - Getting Assist

How Reply A Google Kinds By means of Code? – Getting Assist


Good day mates, I’ve created a Google Kinds hyperlink (https://varieties.gle/vptCsVvXJ6an7gaT7) and I’m making an attempt to ship the solutions from contained in the code. Anybody might assist me to start out, or with some pattern code, how reply a google varieties from contained in the code?

I ma making an attempt the next options:

package deal major

import (
	"fmt"
	"io/ioutil"
	"web/http"
)

func HTTP(url string) (string, error) {
	resp, err := http.Get(url)
	if err != nil {
		return "", fmt.Errorf("GET error: %v", err)
	}
	defer resp.Physique.Shut()

	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("Standing error: %v", resp.StatusCode)
	}

	knowledge, err := ioutil.ReadAll(resp.Physique)
	if err != nil {
		return "", fmt.Errorf("Learn physique: %v", err)
	}

	return string(knowledge), nil
}
func major() {
	fmt.Println("nEnter your identify")
	var identify string
	fmt.Scan(&identify)

	fmt.Println("nEnter e mail:")
	var emailreponse string
	fmt.Scan(&emailreponse)

	HTTP_0 := "https://docs.google.com/varieties/d/e/1FAIpQLSfd8LRjHq4lRdWDb64hoBzTLGaNPn4TLeE5G-2Fp3HhJVcmmg/"
	HTTP_1 := "formResponse?&submit=Submit?"
	HTTP_2 := "usp=pp_url"
	Entry_0 := "&entry.194375880=" + identify
	Entry_1 := "&entry.2012222327=" + emailreponse


	FormResponse, _ := HTTP(HTTP_0 + HTTP_1 + HTTP_2 + Entry_0 + Entry_1)

	fmt.Println(FormResponse)

}

I alter the varieties to this one https://varieties.gle/pevmW2QHyg9QdeDc9 the place the e-mail will not be computerized collected.

However I have no idea how ship this url, I believe use Get will not be the proper method proper?

This subject was routinely closed 90 days after the final reply. New replies are now not allowed.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments