Recent

Author Topic: Send a search query and parsing the received XML  (Read 295 times)

Saylo_49

  • New Member
  • *
  • Posts: 34
Send a search query and parsing the received XML
« on: May 20, 2019, 08:17:23 pm »
Hello

I am looking for how to send a search query in a lazarus project from an inputted TEXT in edit control like this :

http // www . searchengine . com / api-key / searchaction.query=TEXT

and how to receive the response as a XML file containing the search results and how to parse it in the project as separate panels with title and url and other meta-tags included in the received XML
Lazarus 2.0.2 - FPC 3.0.4 - Win32

Leledumbo

  • Hero Member
  • *****
  • Posts: 8103
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Send a search query and parsing the received XML
« Reply #1 on: May 21, 2019, 12:24:45 am »
Sounds like you want to do too much but knowing too little.
  • You issue a request to a URL by using one of the available HTTP client library, the built-in fphttpclient should suffice in most cases
  • You can NOT control what format the server will return as response, it's totally up to the server. You must follow the protocol that the server implements, not the other way around
  • You parse XML using... well... XML parser, available from fcl-xml package
Check the wiki for examples and how to.