MotoMusher Active Member Licensed User Longtime User Jan 23, 2013 #1 I am a new user, but love what I see so far. :sign0104: I need to call a 3rd party web service, which states the following: "To authenticate a user your application will invoke the user service using the HTTP POST method. In order to prevent the username and password from being exposed on the URL, your application will include the following XML in the request body" So, I created a string Code: Copy UserAuthXMLString = "<?xml version=" & Chr(34) & "1.0" & Chr(34) &"?><api><User><email>" UserAuthXMLString = UserAuthXMLString & "[email protected]</email><password>" UserAuthXMLString = UserAuthXMLString & "mypass</password> </User> </api> " I then call: Code: Copy Dim job2 As HttpJob job2.Initialize("Job2", Me) job2.PostString("https://someweb.com/api/xxxx/user", UserAuthXMLString) Is this the correct method to use to send a document body or should I be doing something else? Request is failing and 3rd party verifies email and pass are correct and functioning, so we are down the request itself as the culprit. Thanks for any help you can provide.
I am a new user, but love what I see so far. :sign0104: I need to call a 3rd party web service, which states the following: "To authenticate a user your application will invoke the user service using the HTTP POST method. In order to prevent the username and password from being exposed on the URL, your application will include the following XML in the request body" So, I created a string Code: Copy UserAuthXMLString = "<?xml version=" & Chr(34) & "1.0" & Chr(34) &"?><api><User><email>" UserAuthXMLString = UserAuthXMLString & "[email protected]</email><password>" UserAuthXMLString = UserAuthXMLString & "mypass</password> </User> </api> " I then call: Code: Copy Dim job2 As HttpJob job2.Initialize("Job2", Me) job2.PostString("https://someweb.com/api/xxxx/user", UserAuthXMLString) Is this the correct method to use to send a document body or should I be doing something else? Request is failing and 3rd party verifies email and pass are correct and functioning, so we are down the request itself as the culprit. Thanks for any help you can provide.
Erel B4X founder Staff member Licensed User Longtime User Jan 24, 2013 #2 Your code looks correct. Are you sure that 'User' shouldn't be 'user'? Note that starting with Basic4android you can write quotes inside the string literal by using two quotes: Code: Copy UserAuthXMLString = "<?xml version=""1.0""?><api><User><email>" Upvote 0
Your code looks correct. Are you sure that 'User' shouldn't be 'user'? Note that starting with Basic4android you can write quotes inside the string literal by using two quotes: Code: Copy UserAuthXMLString = "<?xml version=""1.0""?><api><User><email>"