Difference between revisions of "ISDBDownloader::GetURLContentEx"

From MediaMonkey Wiki
Jump to: navigation, search
(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...")
(No difference)

Revision as of 11:44, 14 May 2013


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.GetURLContent("http://pgl.yoyo.org/http/browser-headers.php", Headers, "My Post body")
  MsgBox( Content)
End Sub