• golang http post data
    9 replies, posted
I'm having quite a bit of trouble figuring out post data in golang. Using the standard net/http There's a lot of resources and help for doing a generic parameter based POST request. http.PostForm being one of them. But the issue I have is that I'm working with data that's being sent that's being sent in the request body, instead of URL parameters. So far, I've struggled to even a hint of where to look at. The headers of the request are for url-encoded data, since there is indeed a parameter in the URL to tell the webserver to return an XML formatted document. Most examples I've seen for golang all use url.Values for their form, but using this ends up me returning the login page as response
It might be stored in the environment variables of the shell that calls your golang script, at least that's how it was for me. I wasn't using net/http though, just werc / p9p and Apache.
So just curious, how did it work out?
Nah
aww damn
Reminds me that I have a dump.php file on my local webserver The output of the page from the go script mirrors that when I submit the same query from my browser using cURL And, the webpage does not report the login credentials are invalid. Could it be that cookies are not being stored?
https://files.facepunch.com/forum/upload/1755/f58760a1-d87b-4d5d-ae0d-463820d07fe7/image.png Now comes the fun part Math and string formatting
why dont you just handroll a url query param builder function. It should be easy enough. why get stuck on something so trivial?
I did, first thing I did actually sense, but didn't work, since cookies were not stored
Sorry, you need to Log In to post a reply to this thread.