HTTP Post

So say I need to send a lot of data through HTTP.Get… Obviously we can’t have super-huge url’s and use GET, so I was thinking POST may help?

What header info do I need to try to use POST?

I tried this:

[lua]
http.Get(“http://sassharkey.net/test/shit.php”, "POST /test/shit.php HTTP/1.1
Host:sassharkey.net
Connection: close
Content-type: application/x-www-form-urlencoded
Content-length: “…string.len(data)…”

"…data, function(contents, size) print(contents) end);
[/lua]

But nothing happens.
:frowning:

I thought garry fixed that.

Well, if he did I guess it’d work.
I think it’s something I’m doing wrong though

(PS the links are not pointing to any documents for a reason. Disregard that.)

It isn’t possible yet - but I will look into it for the next update.

Thanks

Could you also make headers work?

Headers should work, kind of. It might be that it only accepts a single header.

Did you test it?

Speaking about testing, are you going to release a beta like 2 days before the big update to eliminate eventual problems that could mess everything up again?

I’d test it if I wanted to use it. I don’t, so I haven’t. If you want to use it and find it doesn’t work let me know.

To be honest, I wouldn’t like the idea of coding/changing something without testing it.

Can’t you just run a quick test when you get the chance?

Here’s some examples what you can do with headers and how to hack them: http://pastebin.com/2Ja8Ehxb

[editline]24th August 2011[/editline]

Basically you replace headers with it, but you can add new headers too or insert garbage after initial header since the validation is rather lax.

[editline]24th August 2011[/editline]

No idea what happens after the update. This might not work anymore.

Yeah why waste your own time when you can waste mine eh?

Well, you could either check it now or when someone comes at you whining that it doesn’t work, and since you probably won’t want to work on gmod after this update (atleast for a while) it would be better that everything you update works probably.

Oh and yes.

Well it’s not gonna get fixed unless you verify it’s not working - so it’s up to you.

Sigh
I’ll test it.

[editline]25th August 2011[/editline]

Single line headers work.

http://spencersharkey.com/bin/be557af72e42a2d7ff85a2989b78668b.png

[editline]25th August 2011[/editline]

http://spencersharkey.com/bin/a2ee7bba4cf4b1ff99a105132fcfd538.png

Multi-lined headers work as well.

Wizard Of Ass, I guess your name states your personality as well.
It works fine.

[editline]25th August 2011[/editline]

To add though, maybe make it so headers can be inserted through tables? Every value is a new header entry?

Thanks for testing - yeah that sounds like it’d be easy enough to do.