I'm trying to make a http post but I get the following in the server console:
[CODE]
httpclient.cpp (2374) : Assertion Failed: pHost && *pHost
Assert( Assertion Failed: pHost && *pHost ):httpclient.cpp:2374
unsuccessful
[/CODE]
Can you show us how are you calling it?
[QUOTE=geferon;50014997]Can you show us how are you calling it?[/QUOTE]
[CODE]
http.Post( "104.131.80.188:9000/ping", "user=user&licence=345bdddfs5&prod=ras&x_version=1.0",
function ( responseText, contentLength, responseHeaders, statusCode )
print( responseText )
print( conentLength )
print( responseHeaders )
print( statusCode )
end,
function( error )
print( error )
end)
[/CODE]
http.Post takes a table as the second argument. What you are trying to do there is a GET request, not a post.
Either use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/http/Fetch]http.Fetch[/url] or use Post as follows:
[lua]http.Post( "104.131.80.188:9000/ping", {user = user, licence = "345bdddfs5", prod = "ras", x_version = "1.0"},
function ( responseText, contentLength, responseHeaders, statusCode )
print( responseText )
print( conentLength )
print( responseHeaders )
print( statusCode )
end,
function( error )
print( error )
end)[/lua]
[QUOTE=MexicanR;50015911][CODE]
http.Post( "104.131.80.188:9000/ping", "user=user&licence=345bdddfs5&prod=ras&x_version=1.0",
function ( responseText, contentLength, responseHeaders, statusCode )
print( responseText )
print( conentLength )
print( responseHeaders )
print( statusCode )
end,
function( error )
print( error )
end)
[/CODE][/QUOTE]
What are you going to use that for ?
[QUOTE=Athods;50016383]What are you going to use that for ?[/QUOTE]
License server, in other words I can check the version people are using & how many people are using one license.
[QUOTE=MexicanR;50016409]License server, in other words I can check the version people are using & how many people are using one license.[/QUOTE]
So you going to use that for an addon ? Are you going to post on scriptfodder ?
[QUOTE=Athods;50016519]So you going to use that for an addon ? Are you going to post on scriptfodder ?[/QUOTE]
Yes an addon, I'm not yet sure whether or not it's going on ScriptFodder (I'm debating if it's worth paying the $15 a month). If I don't post this on ScriptFodder I'm planning on using this to help me fix errors people are having.
This error can be caused if you're calling http.* too early
Sorry, you need to Log In to post a reply to this thread.