patch

HTTP patch content.

T[]
patch
(
T = char
PatchUnit
)
(
const(char)[] url
,
const(PatchUnit)[] patchData
,
HTTP conn = HTTP()
)
if (
is(T == char) ||
is(T == ubyte)
)

Parameters

url const(char)[]

resource to patch

patchData const(PatchUnit)[]

data to send as the body of the request. An array of an arbitrary type is accepted and will be cast to ubyte[] before sending it.

conn HTTP

HTTP connection to use

The template parameter T specifies the type to return. Possible values are char and ubyte to return char[] or ubyte[].

Return Value

Type: T[]

A T[] range containing the content of the resource pointed to by the URL.

Examples

auto http = HTTP();
http.addRequestHeader("Content-Type", "application/json");
auto content = patch("https://httpbin.org/patch", `{"title": "Patched Title"}`, http);

See Also

Meta