From MediaMonkey Wiki
Revision as of 11:47, 14 May 2013 by Ludek (talk | contribs) (Example code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


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

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("", Headers, "My Post body")
  MsgBox( Content)
End Sub