Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

Http

HTTP Client for downloading files

Nested types and modules

TypeDescription
DownloadParameters

Input parameter type

PostMethod

Option type for the HTTP verb

Functions and values

Function or valueDescription
downloadFile localFilePath uri
Signature: localFilePath:string -> uri:string -> string

Download file by the given file path and Uri string -> string -> string

Parameters

  • localFilePath - A local file path to download file
  • uri - A Uri to download from

Returns

  • string type. Contains a downloaded file path
downloadFiles(input)
Signature: input:DownloadParameters list -> string list

Download list of Uri's in parallel DownloadParameters -> string list

Parameters

  • input - List of Http.DownloadParameters. Each Http.DownloadParameters record type contains Uri and file path

Returns

  • string list type. Contains a list of downloaded file paths
get userName password url
Signature: userName:string -> password:string -> url:string -> string

Executes an HTTP GET command and retrives the information. It returns the response of the request, or null if we got 404 or nothing.

Parameters

  • userName - The username to use with the request.
  • password - The password to use with the request.
  • url - The URL to perform the GET operation.
getWithHeaders(...)
Signature: userName:string -> password:string -> headerF:(HttpRequestHeaders -> unit) -> url:string -> Map<string,string list> * string

Like 'get' but allow to set headers and returns the response headers.

post url userName password data
Signature: url:string -> userName:string -> password:string -> data:string -> string

Executes an HTTP POST command and retrives the information. It returns the response of the request, or null if we got 404 or nothing.

Parameters

  • url - The URL to perform the POST operation.
  • userName - The username to use with the request.
  • password - The password to use with the request.
  • data - The data to post.
postCommand(...)
Signature: headerF:(HttpRequestHeaders -> unit) -> url:string -> userName:string -> password:string -> data:string -> string

Executes an HTTP POST command and retrives the information.
This function will automatically include a "source" parameter if the "Source" property is set. It returns the response of the request, or null if we got 404 or nothing.

Parameters

  • headerF - A function which allows to manipulate the HTTP headers.
  • url - The URL to perform the POST operation.
  • userName - The username to use with the request.
  • password - The password to use with the request.
  • data - The data to post.
upload url file
Signature: url:string -> file:string -> unit

Upload the given file to the given endpoint