First, cool dog lyrics search Indy tidhttp

Source: Internet
Author: User

Cool Dog Lyrics url:http://lib9.service.kugou.com/websearch/index.php?page=1&cmd=100&pagesize=9&keyword= + song name

Cool Dog Lyrics code: UTF-8

Chinese song name Turn UTF8 code

1 functionStrtohex (str:string; aencoding:tencoding):string;2 var3 Ss:tstringstream;4 I:integer;5 begin6Result: ="';7SS: =tstringstream.create (str, aencoding);8   Try9      forI: =0  toSs. Size-1  DoTenResult: = result +'%'+ Format ('%.2x', [SS. Bytes[i]]); One   finally A SS. Free; -   End; - End;

Strtohex (lyrics, Tencoding.utf8)

Tidhttp Calling code

1   functionHttpgetbystream (URL:string; aencoding:tencoding): Tstringstream;2   begin3    Try4Result: = Tstringstream.create ("', aencoding);5Fidhttp: = Tidhttp.create (Nil);6Fidhttp.connecttimeout: = the;7Fidhttp.readtimeout: =6000;8 Fidhttp.get (FURL, Result);9    finallyTen Fidhttp.disconnect; One Freeandnil (fidhttp); A      End; -   End; -  the var - Restreambuff:tstringstream; - begin -//instantiates a string stream in Utf8 encoded format, +Restreambuff: = Tstringstream.create ("', Tencoding.utf8); -         Try +Restreambuff: =Httpgetbystream (FURL, Tencoding.utf8); A// Dodatasting; at         finally - Restreambuff.free; -         End; - End;

The last parsed Restreambuff is a string stream, and its datastring is a JSON string

Using the system's own System.json class parsing can

First, cool dog lyrics search Indy tidhttp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.