![]() Success := CkRest_AddHeader(rest, 'Content-Type', 'application/json charset=UTF-8') Add the Content-Type HTTP request header. Success := CkRest_AddQueryParam(rest, 'project', 'chilkattest-1050') Show the HTTP request body we'll be sending. Success := CkJsonObject_AddBoolAt(pObjVersioning, -1, 'enabled', True) PObjVersioning := CkJsonObject_ObjectOf(jsonReqBody, 'versioning') Success := CkJsonObject_AddObjectAt(jsonReqBody, -1, 'versioning') Success := CkJsonObject_AddStringAt(jsonReqBody, -1, 'location', 'US') Success := CkJsonObject_AddStringAt(jsonReqBody, -1, 'kind', 'storage#bucket') Success := CkJsonObject_AddStringAt(jsonReqBody, -1, 'name', 'chilkat-bucket-c') The only required property is the "name", but we'll add more // to make a better example. Build the JSON request body for creating a bucket. Success := CkRest_SetAuthGoogle(rest,gAuth) ![]() Provide the authentication credentials (i.e. Success := CkRest_Connect(rest, '443, True,bAutoReconnect) Obtain an access token as shown in one of the following examples: // See Get Access Token using a Service Account JSON Key // See Get Access Token using a P12 File ![]() See Global Unlock Sample for sample code. It requires the Chilkat API to have been previously unlocked. Procedure TForm1.Button1Click(Sender: TObject) īegin // This example will create a bucket in Google Cloud Storage. Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AuthGoogle, JsonObject, Rest Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, * The examples here use the non-ActiveX DLL. This example will create a bucket in Google Cloud Storage (which involves sending and receiving JSON). (Delphi DLL) Send JSON REST Request, Get JSON Responseĭemonstrates sending a RESTful JSON request, and receiving a JSON response. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |