www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Use Requests to send data to webpage - how?

reply TheDGuy <a.b gmail.com> writes:
Hi,
i was sucessfull in installing requests and getting data from a 
webpage like this:

Request rq = Request();
Response rs = rq.exec!"GET"("http://somewebpage.org/SQL.php", 
["action":"getTemp"]);

But i am not able to send data to the webpage like this:

Request rq = Request();
Response rs = rq.exec!"GET"("http://somewebpage.org", 
[parameter:data]);

If i just type this:

http://somewebpage.org/?parameter=data

in my browser the webpage reacts as intended but with the 
Requests "GET" nothing happens. Do you know what i do wrong?
May 19 2016
next sibling parent Seb <seb wilzba.ch> writes:
On Thursday, 19 May 2016 at 19:28:46 UTC, TheDGuy wrote:
 Hi,
 i was sucessfull in installing requests and getting data from a 
 webpage like this:

 Request rq = Request();
 Response rs = rq.exec!"GET"("http://somewebpage.org/SQL.php", 
 ["action":"getTemp"]);

 But i am not able to send data to the webpage like this:

 Request rq = Request();
 Response rs = rq.exec!"GET"("http://somewebpage.org", 
 [parameter:data]);

 If i just type this:

 http://somewebpage.org/?parameter=data

 in my browser the webpage reacts as intended but with the 
 Requests "GET" nothing happens. Do you know what i do wrong?
Open an issue at the repo of the package you installed. Looks like it's an error.
May 19 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
Does this work?

Request rq = Request();
Response rs = rq.exec!"GET"("http://somewebpage.org/", 
[parameter:data]);
May 20 2016
parent reply TheDGuy <a.b gmail.com> writes:
On Friday, 20 May 2016 at 09:21:33 UTC, Kagamin wrote:
 Does this work?

 Request rq = Request();
 Response rs = rq.exec!"GET"("http://somewebpage.org/", 
 [parameter:data]);
No :(
May 20 2016
parent TheDGuy <a.b gmail.com> writes:
On Friday, 20 May 2016 at 14:42:19 UTC, TheDGuy wrote:
 On Friday, 20 May 2016 at 09:21:33 UTC, Kagamin wrote:
 Does this work?

 Request rq = Request();
 Response rs = rq.exec!"GET"("http://somewebpage.org/", 
 [parameter:data]);
No :(
If i call my SQL.php function directly with: Response rs = rq.exec!"GET"("http://site/SQL.php", ["action":"insertTemp","value":"7"]); it works perfectly fine. But i don't understand why my html site does not get that request...Any ideas?
May 22 2016