luke2012 Well-Known Member Licensed User Longtime User Sep 12, 2017 #1 Hi all, is there a test server where I can test the BASIC authentication using a POST ? B4X: job3.Initialize("Job3", Me) job3.Username = "xxx" job3.Password = "yyy" job3.PostString("http://www.example.com", "key1=val1&key2=val2")
Hi all, is there a test server where I can test the BASIC authentication using a POST ? B4X: job3.Initialize("Job3", Me) job3.Username = "xxx" job3.Password = "yyy" job3.PostString("http://www.example.com", "key1=val1&key2=val2")
eurojam Well-Known Member Licensed User Longtime User Sep 12, 2017 #2 take a look to: http://httpbin.org/ Upvote 0
DonManfred Expert Licensed User Longtime User Sep 12, 2017 #3 eurojam said: take a look to: http://httpbin.org/ Click to expand... I didn´t know this... Thank you for pointing it here Upvote 0
eurojam said: take a look to: http://httpbin.org/ Click to expand... I didn´t know this... Thank you for pointing it here
eurojam Well-Known Member Licensed User Longtime User Sep 12, 2017 #4 DonManfred said: I didn´t know this... Thank you for pointing it here Click to expand... but it does only GET requests, so not that helpful for the original question... Upvote 0
DonManfred said: I didn´t know this... Thank you for pointing it here Click to expand... but it does only GET requests, so not that helpful for the original question...
DonManfred Expert Licensed User Longtime User Sep 12, 2017 #5 eurojam said: but it does only GET requests, so not that helpful for the original question... Click to expand... right Check http://donmanfred.basic4android.de/images/?var1=test (or even with post) Username: b4a Password: b4xb4x PHP: <?php header('Content-type: text/plain; charset=UTF-8'); if(sizeof($_REQUEST) > 0){ foreach($_REQUEST as $name => $value){ echo date("d.m.Y H:i:s", time()).": ".$name."=".$value."\r\n"; } } ?> Last edited: Sep 12, 2017 Upvote 0
eurojam said: but it does only GET requests, so not that helpful for the original question... Click to expand... right Check http://donmanfred.basic4android.de/images/?var1=test (or even with post) Username: b4a Password: b4xb4x PHP: <?php header('Content-type: text/plain; charset=UTF-8'); if(sizeof($_REQUEST) > 0){ foreach($_REQUEST as $name => $value){ echo date("d.m.Y H:i:s", time()).": ".$name."=".$value."\r\n"; } } ?>
luke2012 Well-Known Member Licensed User Longtime User Sep 12, 2017 #6 Thanks @eurojam and @DonManfred I try it... Upvote 0
luke2012 Well-Known Member Licensed User Longtime User Sep 12, 2017 #7 DonManfred said: right Check http://donmanfred.basic4android.de/images/?var1=test (or even with post) Username: b4a Password: b4xb4x PHP: <?php header('Content-type: text/plain; charset=UTF-8'); if(sizeof($_REQUEST) > 0){ foreach($_REQUEST as $name => $value){ echo date("d.m.Y H:i:s", time()).": ".$name."=".$value."\r\n"; } } ?> Click to expand... @DonManfred Basic Authentication work fine. I did a test: Wow! My first web service call using B4A B4X: Dim j1 As HttpJob j1.Initialize("j1", Me) j1.Username = "b4a" j1.Password = "b4xb4x" j1.PostString("http://donmanfred.basic4android.de/images/?var1=test", "") 'Result from log: 12.09.2017 18:44:41: var1=test Last edited: Sep 12, 2017 Upvote 0
DonManfred said: right Check http://donmanfred.basic4android.de/images/?var1=test (or even with post) Username: b4a Password: b4xb4x PHP: <?php header('Content-type: text/plain; charset=UTF-8'); if(sizeof($_REQUEST) > 0){ foreach($_REQUEST as $name => $value){ echo date("d.m.Y H:i:s", time()).": ".$name."=".$value."\r\n"; } } ?> Click to expand... @DonManfred Basic Authentication work fine. I did a test: Wow! My first web service call using B4A B4X: Dim j1 As HttpJob j1.Initialize("j1", Me) j1.Username = "b4a" j1.Password = "b4xb4x" j1.PostString("http://donmanfred.basic4android.de/images/?var1=test", "") 'Result from log: 12.09.2017 18:44:41: var1=test
DonManfred Expert Licensed User Longtime User Sep 12, 2017 #8 you did not post anything... the post is empty The value you are given is given with GET parameter Upvote 0
luke2012 Well-Known Member Licensed User Longtime User Sep 13, 2017 #9 DonManfred said: you did not post anything... the post is empty The value you are given is given with GET parameter Click to expand... I updated the test code (it works fine): B4X: j1.PostString("http://donmanfred.basic4android.de/images/", "var1=test1&var2=test2") Web Service response: 13.09.2017 10:42:16: var1=test1 13.09.2017 10:42:16: var2=test2 I'm testing the authentication and if the web service gets and process the passed parameters correctly. Last edited: Sep 13, 2017 Upvote 0
DonManfred said: you did not post anything... the post is empty The value you are given is given with GET parameter Click to expand... I updated the test code (it works fine): B4X: j1.PostString("http://donmanfred.basic4android.de/images/", "var1=test1&var2=test2") Web Service response: 13.09.2017 10:42:16: var1=test1 13.09.2017 10:42:16: var2=test2 I'm testing the authentication and if the web service gets and process the passed parameters correctly.