![]() ![]() ![]() O buffer de matriz é passado no corpo da solicitação POST.Įstes exemplos usam o ponto de extremidade getfolderbyserverrelativeurl para alcançar o conjunto de arquivos, mas você também pode usar um ponto de extremidade de lista (exemplo: A função jQuery(document).ready verifica o suporte à API FileReader no navegador.Īdicionar o arquivo à pasta Documentos Compartilhados usando o método Add no conjunto de arquivos da pasta. i feeds.Os exemplos de código neste artigo usam as solicitações jQuery AJAX e a interface REST para adicionar um arquivo local à biblioteca de Documentos e, em seguida, alterar as propriedades do item da lista que representa o arquivo carregado.Įsse processo usa as seguintes etapas de alto nível:Ĭonverter o arquivo local em um buffer de matriz usando a API FileReader, o que exige suporte do HTML5. phi /sr/dfl.png phi / 115 30ĭ - All Delphi blogs in one place. The data extracted would look like the following (which I've somewhat simplified for readability), when displayed in an XML editor:įile Edit Search Document DocServer XSL GXI Heip J Untitledl |Īll Delphi blogs directly from en-us_ The first component is used to grab the data from the Web and load it in the second component: var strXml: string begin strXml := IdHTTPl.Get The RssClient program uses an IdHttp component and an XMLDocument component. Every time you access dynamic XML data using an URL and you can change the URL to access different data, you are using the REST approach. That's why, as a first example of a client application using REST, I wrote a very simple RSS client106 looking into blogs at this site. Feed information is processed by these client applications, and at times even combined in a summary of similar feeds, as happens on the Delphi Feeds site: I The interesting point about feeds is they provide the same information to client applications that a user will generally access using a web browser. ![]() The most widespread format for distributing information as XML is the use of the RSS and ATOM feeds, mostly attached to blog and news sites, but equally usable for any data source. In this chapter I'll cover only a few selected examples: a first demo of accessing RSS feeds (which uses XML and XPath), two mapping demos (based on different return types), and a translation example which used JSON. You can also find more coverage of REST clients written in Delphi in the paper on REST that I wrote for Embarcadero Technologies, which is based on the material of this chapter: For a much longer list of Delphi REST clients that I have written, you can refer to the specific section of one of my web sites: I Exemplo rest delphi free#Even if the number of web services that uses REST on the Internet is high, most actual web services require some developer token (as covered in some of the coming demos), while only a handful offer totally free and open access. There are countless examples of REST servers that you can find on the Web. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |