Questions tagged [go-gin]

Gin is a Go-written web framework specifically designed for HTTP.

When trying to access [Apiurl] from Vue and Golang, an error occurs due to the CORS policy blocking the XMLHttpRequest. The request header field 'authorization' is not allowed

As a newcomer to Vuejs and golang, I encountered an issue when attempting to send an Authorization token through the header while making an API call from Vue Axios. The error message that was displayed is as follows: "Access to XMLHttpRequest at 'htt ...

Use Go lang with Gin to return an empty array instead of null for JSON responses

I have a struct: type ProductConstructed struct { Name string `json:"Name"` BrandMedals []string `json:"BRAND_MEDALS"` } When I use gin to return my object: func constructProduct(c *gin.Context) { var response ProductConst ...

Encountering CORS Issue with Golang and Gin following a Redirect Situation

I am currently working on implementing Google OAuth2 in my Go web server using Gin. I have integrated two new endpoints - /google/sign-in and /google/callback. The former receives the request and redirects to the Google auth URL, while the latter is trigge ...