Web request and response

Status
Not open for further replies.

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
I have this problem with Web.GET("url") and Web.POST("url", data)
When they are used nothing happens and fail...

Ok... if this gets fixed to me then I need response.. To get it I used:
Python:
response = Web.GET("url")
Will it work then?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
I have this problem with Web.GET("url") and Web.POST("url", data)
When they are used nothing happens and fail...

Ok... if this gets fixed to me then I need response.. To get it I used:
Python:
response = Web.GET("url")
Will it work then?
What is the url that you are typing?
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
I am trying to do
Python:
response = Web.GET("http://www.example.com/ban.php?name=" + name + "&steamid=" + id + "&ip=" + ip
AND
Python:
response = Web.GET("http://www.example.com/ban.php?name=Skully&steamid=76567989123123&ip=127.0.0.1"
AND LAST JUST
Python:
response = Web.GET("http://www.example.com/ban.php"
What gives just echo...
Every time is the same... Nothing happens and if it all is in try: and except: then it goes to except when reaches this Web.GET line
What is the problem?

--EDIT--
P.S. Hiding site for security porpoise! Will have ban database :)
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
I am trying to do
Python:
response = Web.GET("http://www.example.com/ban.php?name=" + name + "&steamid=" + id + "&ip=" + ip
AND
Python:
response = Web.GET("http://www.example.com/ban.php?name=Skully&steamid=76567989123123&ip=127.0.0.1"
AND LAST JUST
Python:
response = Web.GET("http://www.example.com/ban.php"
What gives just echo...
Every time is the same... Nothing happens and if it all is in try: and except: then it goes to except when reaches this Web.GET line
What is the problem?

--EDIT--
P.S. Hiding site for security porpoise! Will have ban database :)
I created something like this on legacy, but you are missing a ) at the end of the line
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
Python:
response = Web.GET("http://www.example.com/ban.php?name=Skully&steamid=76567989123123&ip=127.0.0.1")
Yes... My fault, typed as example and missed it here! But in code I have it! But it doesn't work... ")" is not the fault...
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
@DreTaX did you got the delay working?
Seems that I am so shitty programmer that I can't get timer to do Callback... :( (shame)...
But I like web site programming and php + sql can make so much good thing for rust who has site!
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
Looks like it's an issue with ironpython or the way I imported it, let me try a few things.
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
@DreTaX did you got the delay working?
Seems that I am so shitty programmer that I can't get timer to do Callback... :( (shame)...
But I like web site programming and php + sql can make so much good thing for rust who has site!
I'm not sure, i put my tpfriend plugin in it's discussions for people to test it. I'm really unsure tho.
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
Can the timer run without data and do Callback then? Like: Plugin.CreateTimer("TestTimer", 10000).Start() OR Plugin.CreateParallelTimer("TestTimer", 10000).Start()
I tryed with data and without... no luck... If you are not against it baby I can look for some examples and take (some) lines? I am new to PY how you know and it get's me to the code if I see the example and fool around with it... :)
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
I know.how to do a simple timer, but not Parllarel, i havent tried that yet.
I will copy it in amin

Sent from my Samsung Galaxy S4
 

balu92

Retired Staff
Retired Staff
Trusted Member
Jul 11, 2014
338
75
28
34
Can the timer run without data and do Callback then? Like: Plugin.CreateTimer("TestTimer", 10000).Start() OR Plugin.CreateParallelTimer("TestTimer", 10000).Start()
I tryed with data and without... no luck... If you are not against it baby I can look for some examples and take (some) lines? I am new to PY how you know and it get's me to the code if I see the example and fool around with it... :)
you can't create parallel timers without data, that's the only point of a parallel timer, to have different data
you can do normal timers without data
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,091
4,767
113
At your house.
github.com
Can the timer run without data and do Callback then? Like: Plugin.CreateTimer("TestTimer", 10000).Start() OR Plugin.CreateParallelTimer("TestTimer", 10000).Start()
I tryed with data and without... no luck... If you are not against it baby I can look for some examples and take (some) lines? I am new to PY how you know and it get's me to the code if I see the example and fool around with it... :)
Python:
def NekerCallback(self, timer):
       Server.Broadcast("omg")

    def On_PluginInit(self):
        Plugin.CreateTimer("Neker", 1000).Start()
 

Skully

Plugin Developer
Plugin Developer
Sep 8, 2014
91
7
8
Python:
def NekerCallback(self, timer):
       Server.Broadcast("omg")

    def On_PluginInit(self):
        Plugin.CreateTimer("Neker", 1000).Start()
Thanks... This somehow works and I will use this as base :) Now just some cfg.ini and will share source to you on github...
 
Status
Not open for further replies.