Einzelnen Beitrag anzeigen

Rabihan35

Registriert seit: 25. Apr 2020
3 Beiträge
 
#1

RestRequest with Post Var

  Alt 25. Apr 2020, 19:15
Hi everyone,

I have the following problem, I'm doing a restclient application which will send request to a Restserver API, i was able to connect and getthe responses of my requests,
now the problem is when I'm sending the request with Parameters, the server is ignoring them, or at least the filter parameters are ignored, the required information, which are timestamp, salt and signature are accepted but all others are ignored. as an example from the documentation of the Server's API i have the following php example:

// The GET vars
$GET_VARS = array(
"go" => "clips",
"do" => "list"
);

// The POST vars
$POST_VARS = array(
"fields" => "id,title", // Include only id, and title
"paging" => 1, // Allow paging
"resultsPerPageFilter" => 5, // Return 5 results per page
"current_page" => 1, // Return the page No. 1
"statusFilter" => "any", // Include Clips with any status
"sortByFilter" => "date", // Sort Clips by date (latest first)
"generateEmbedCode" => 1, // Generate embed code for each Clip
"embedWidth" => 400, // Set the Embed code Width = 400px
"embedHeight" => 225, // Set the Embed code Height = 225px
"embedURLVars" => "&autoplay=1" // Include the Video Player vars in the Embed code
);

form delphi I was able to send the get var in addition to the required information and the server response is ok, but I was not able sending the other variables (pos_var)


// get the signature
Signature := getSignature(TimeStamp, Salt);

RESTRequest1.AddParameter('go','clips');
RESTRequest1.AddParameter('do','list');
RESTRequest1.AddParameter('timestamp',TimeStamp);
RESTRequest1.AddParameter('salt',Salt);

RESTRequest1.AddParameter('key',KeyID);

RESTRequest1.AddParameter('signature',Signature); ----> till this point everything is OK

RESTRequest1.AddParameter('fields','title'); ------> this parameter is ignored same as all the others in the POST_VAR!!!!


ResponseMemo.Lines.Add('Request: '+RESTRequest1.GetFullRequestURL(True));
//using Methode = rmGet
RESTRequest1.Execute;
jValue:=RESTResponse1.JSONValue;
ResponseMemo.Text:= jValue.ToString;

I have no idea how to send the POST_VAR shown in the PHP example.

thanks for all the help I get
  Mit Zitat antworten Zitat