For authentication you have to execute POST "http://www.sitename.com/api/token" url with the body having the following format: username=5000&grant_type=password&password=ABC123 You'll get a response having "access_token" property in it. This token should be passed in every authenticated request in header like this: Authorization: bearer [access_token here]This is the code the author is using (that authenticates the user) in WinForms:
var request = new RestRequest("/token", Method.POST); request.AddParameter("grant_type", "password"); request.AddParameter("username", textBoxUserName.Text); request.AddParameter("password", textBoxPassword.Text); var response = _client.Execute<AuthResponse>(request);In VFP I am trying to use the West Wind Client Tool, specifically the class wwjSonServiceClient. The sample code in VFP is as follows:
loProxy = CREATEOBJECT("wwJsonServiceClient") oAlbums = loProxy.CallService("http://albumviewerswf.west-wind.com/api/albums","","GET")I believe that when I call the CallService instead of "GET" I will have "POST". But I need to pass the 'request' object in the place of the empty string (above "") (right?). And I don't know how to create such a 'request' object in VFP.