ISDBDownloader::GetURLContentEx

From MediaMonkey Wiki
Revision as of 11:44, 14 May 2013 by Ludek (talk | contribs) (Created page with "===Parameters=== {{MethodParameters |URL |String |URL of the content to get |Headers | ISDBStringList| Custom request headers to send (e.g. "Accept-Language: en-us") |Bo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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.GetURLContent("http://pgl.yoyo.org/http/browser-headers.php", Headers, "My Post body")
  MsgBox( Content)
End Sub