The Android app – like all Web API clients – must submit valid credentials in the designated format every time it requests or posts data. Specifically, this means adding an Authorization header to each HTTP Request.
The sample app uses the simpler RWX_BASIC scheme in which the header value is composed of the scheme identifer (RWX_BASIC) + a space + the username + a colon + the user's password.
Note: Because RWX_BASIC passes credentials in clear text, the default AuctionWorx site requires SSL (HTTPS) to secure all Web API interactions.
The following snippet shows the use of the TryAddWithoutValidation() method in the HttpClient object to add the Authorization header.
Notice the space after RWX_BASIC and the colon between the username and password:
var client = new HttpClient(); client.DefaultRequestHeaders.TryAddWithoutValidation ("Authorization", "RWX_BASIC " + username + ":" + password);
Copyright © 2002-2022. RainWorx Software. All rights reserved.