ISDBDownloader::GetURLContentEx

From MediaMonkey Wiki
Jump to navigation Jump to search

Parameters

Name Type Description
URL String URL of the content to get
Headers ISDBStringList Custom request headers to send (e.g. "Accept-Language: en-us")
Body String Body to POST, if the Body is empty string then HTTP GET is used otherwise HTTP POST method is used


Method description

Returns URL content.

Added in MediaMonkey 4.1.0.1638

Example code

Option Explicit

Dim UI  : Set UI = SDB.UI

Sub OnStartUp()
    Dim mnuTest

    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = SDB.Localize("Get URL content")
    mnuTest.OnClickFunc = "SDBOnClick"
    mnuTest.UseScript = Script.ScriptPath   
End Sub

Sub SDBOnClick(Item)   
  Dim Headers
  Set Headers = SDB.NewStringList 
  Headers.Add "Accept-Language: en-us"
  Headers.Add "My-Header: My Custom Header Content"
  Dim Content
  Content = SDB.Downloader.GetURLContentEx("http://pgl.yoyo.org/http/browser-headers.php", Headers, "My Post body")
  MsgBox( Content)
End Sub