svc, err := indexing.NewService() res, err := svc.UrlNotifications.Publish(&indexing.UrlNotification{ /* things in here */ }).Do()
On Monday, November 8, 2021 at 6:59:31 PM UTC+1 ladonkin...@gmail.com wrote: > Hi, > > I'm new to Golang so sorry if the question seems stupid. > > I'm trying to inform google about a new job on my website using the > following documentation - > https://developers.google.com/search/apis/indexing-api/v3/prereqs > > At the end of the page they provide the instructions of how to do it using > different languages, but unfortunately not with Go. I found the following > library - https://github.com/googleapis/google-api-go-client - which > seems to be right for the task but I'm not sure how to use it properly - > all I came up with is: > > ctx := context.Background() > indexingService, err := indexing.NewService(ctx) > indexingService.BasePath = " > https://indexing.googleapis.com/v3/urlNotifications:publish" > > But I don't know how to send the request or how to include the body into > it (and I'm not sure about the part that I wrote as well, to be honest). > > Maybe someone has already had some experience with it and can point me to > the right direction? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/72bb3c7c-52ce-4130-bfe8-126197cadc8en%40googlegroups.com.