I'm a newbie when it comes to Go and Gin, so please excuse my ignorance.
I've setup a server using Gin which supports a POST request. I would like the user to POST their request which includes a required JSON payload redirecting that request to another URL. As part of the redirect I need to pass the original JSON payload. For example, if the user issues this CURL request:
curl -H "Content-Type: application/json" -d '{ "name": "NewTest Network", "organizationId": 534238, "type": "wireless"}' -X POST "http://localhost:8080/network"
My Gin code does this:
r.POST("/network", func(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, networks_url)
})
where: networks_url is the redirected URL. I need a way to pass the original JSON payload to the redirected URL.
Any help you could provide would be greatly appreciated.