Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-10

Plivo API

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

I am wetting my feet in Plivo API (www.plivo.com).

"
Plivo communicates with remote applications built by businesses through a series of API calls. These back and forth calls between Plivo and other applications are communicated through XML (Extensible Markup Language).
"

Say that at a given time Plivo calls application X with HTTPS/Post and passes it a XML file.

I need to write a minimal application X in Lazarus that will write the XML file to disk

Could you point me to some sample code possibly using Synapse ?

Thank you

Peppe Polpo

Reply by email

Mehmet Erol Sanliturk
to duilio foschi

On Sun, Oct 2, 2016 at 11:45 AM, duilio foschi via Lazarus <

Show quoted text 25 lines
wrote: I am wetting my feet in Plivo API (www.plivo.com). " Plivo communicates with remote applications built by businesses through a series of API calls. These back and forth calls between Plivo and other applications are communicated through XML (Extensible Markup Language). " Say that at a given time Plivo calls application X with HTTPS/Post and passes it a XML file. I need to write a minimal application X in Lazarus that will write the XML file to disk Could you point me to some sample code possibly using Synapse ? Thank you Peppe Polpo -- _______________________________________________

Perhaps the following sites may be useful :

www.aggpas.org
www.antigrain.com

In them , there are some XML ( expat , etc. ) related files .

Be careful about licenses of releases .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161002/f6e8f425/attachment.html>

Reply by email

Mattias Gaertner
to duilio foschi: I am wetting my feet in Plivo API (www.plivo.com). " Plivo communicates with remote…
Show quoted text 16 lines
I am wetting my feet in Plivo API (www.plivo.com). " Plivo communicates with remote applications built by businesses through a series of API calls. These back and forth calls between Plivo and other applications are communicated through XML (Extensible Markup Language). " Say that at a given time Plivo calls application X with HTTPS/Post and passes it a XML file. I need to write a minimal application X in Lazarus that will write the XML file to disk Could you point me to some sample code possibly using Synapse ?

You don't need Synapse if you only need to download a file. FPC provides a HTTP client:

function DownloadText(const URL: string): TStrings;
var
  client: TFPHTTPClient;
  doc: TStringList;
begin
  Result:=nil;
  doc:=TStringList.Create;
  client:=TFPHTTPClient.Create(nil);
  try
    client.Get(URL,doc);
    Result:=doc;
    doc:=nil;
  finally
    doc.Free;
    client.Free;
  end;
end;

Mattias

Reply by email

duilio foschi
to Mattias Gaertner

Hi Mattias,

your code shows what Plivo probably does :)

After recording a call, Plivo will call my remote application X (I will write the URI of X in a configuration file) with Https/Post.

At the time of the request Plivo passes the URI of a MP3 file to application X.

This information is written in a XML file, but lets say a text file just to hide details.

I need to write application X.

This application X wont make calls, but will be called from 3th party software (Plivo).

How do I read the parameters passed when a Https/Post request is done to my code ?

Thank you

Peppe

2016-10-02 21:36 GMT+02:00 Mattias Gaertner via Lazarus :

Show quoted text 48 lines
On Sun, 2 Oct 2016 20:45:08 +0200 duilio foschi via Lazarus wrote: > I am wetting my feet in Plivo API (www.plivo.com). > > " > Plivo communicates with remote applications built by businesses > through a series of API calls. These back and forth calls between > Plivo and other applications are communicated through XML (Extensible > Markup Language). > " > > Say that at a given time Plivo calls application X with HTTPS/Post and > passes it a XML file. > > I need to write a minimal application X in Lazarus that will write the > XML file to disk > > Could you point me to some sample code possibly using Synapse ? You don't need Synapse if you only need to download a file. FPC provides a HTTP client: function DownloadText(const URL: string): TStrings; var client: TFPHTTPClient; doc: TStringList; begin Result:=nil; doc:=TStringList.Create; client:=TFPHTTPClient.Create(nil); try client.Get(URL,doc); Result:=doc; doc:=nil; finally doc.Free; client.Free; end; end; Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

Reply by email