Another REST client demo that I wrote for recent conferences is a VCL client accessing to some music information, different than the demo I blogged about last week. The new demo, in fact, uses the same service but makes a different request, as you can see from the following REST client components settings:

object RESTClient1: TRESTClient
  BaseURL = ''

object RESTRequest1: TRESTRequest
  Client = RESTClient1
  Params = <
      Kind = pkURLSEGMENT
      name = 'NAME'
      Options = [poAutoCreated]
      Value = 'Michael Jackson'
  Resource = 'artist/{NAME}'
  Response = RESTResponse1

As you can see, the URI ('artist/{NAME}') has an internal parameter, enclosed in curly braces, and this value automatically adds a proper parameter definition to the RESTRequest component. This parameter is of type URL segment. Rather than composing the URL manually, the core URL, the URI and the parameters are automatically combined by the REST client library into the actual HTTP request. To pass a specific value for the search, all you have to do is to replace the default value of the parameter:

procedure TForm4.btnJsonClick(Sender: TObject);
  rParam: TRESTRequestParameter;
  jValue: TJSONValue;
  rParam := RESTRequest1.Params.ParameterByName('NAME');
  if Assigned (rParam) then
    rParam.Value := edName.Text;
    jValue := RESTResponse1.JSONValue;
    if jValue is TJSONObject then
      MemoOutput.Text := TJSONObject(jValue).GetValue('artist').ToString
      MemoOutput.Text := jValue.ToString;

Notice that the result is a JSON object I'm processing manually to extract the information I'm looking for. Here is the output of the program:

Again the complete source code is available on my "session demos" repository at while the subversions URL for the entire set of demos is at (And this time it should work, sorry for the subversions server misconfiguration when I wrote my previous blog post).

PS: As you can see, this is a brand new capability added to the VCL in Delphi XE5 Professional. And it is not the only one: Delphi XE5 VCL developers have also the benefits of FireDAC (available in different configurations in all edition starting with the Professional one). Plus, there are currently upgrade offers if you are still on older versions of the product at