![]() |
RestRequest with Post Var
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 |
AW: RestRequest with Post Var
I am not familiar with PHP, but you can try this for all $POST_VARS parameter:
Delphi-Quellcode:
...
RESTRequest1.AddParameter('fields','title', TRESTRequestParameterKind.pkREQUESTBODY); ... |
AW: RestRequest with Post Var
thanks for your reply, will try it and let you know.
|
AW: RestRequest with Post Var
I have no idea why but it still ignoring the parameters. would it work if i use indy instead?
thanks |
AW: RestRequest with Post Var
It should work with both systems. Do you have a working PHP (or other) solution where you can intercept the request for an analysis?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:16 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz