View Source ExOnvif.Request (ExOnvif v0.7.1)
Module describing an onvif request.
Summary
Functions
Add namespaces to the request.
Serializes the request to a string.
Puts a new header in the request.
Types
@type t() :: %ExOnvif.Request{ content: any(), header: ExOnvif.Request.Header.t(), namespaces: list() }
Functions
Add namespaces to the request.
iex> request = %ExOnvif.Request{content: "content"} iex> request = ExOnvif.Request.add_namespaces(request, ["xmlns:wsse": "http://www.w3.org/2003/05/soap-envelope"]) %ExOnvif.Request{content: "content", namespaces: ["xmlns:wsse": "http://www.w3.org/2003/05/soap-envelope"]} iex> ExOnvif.Request.add_namespaces(request, ["xmlns:wsa": "http://www.w3.org/2005/08/addressing"]) %ExOnvif.Request{content: "content", namespaces: ["xmlns:wsa": "http://www.w3.org/2005/08/addressing", "xmlns:wsse": "http://www.w3.org/2003/05/soap-envelope"]}
Serializes the request to a string.
iex> request = %ExOnvif.Request{content: "content", namespaces: ["xmlns:s": "http://www.w3.org/2003/05/soap-envelope"]} iex> ExOnvif.Request.encode(request) "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\">\n content\n</s:Envelope>"
Puts a new header in the request.
iex> request = %ExOnvif.Request{content: "content"} iex> ExOnvif.Request.put_header(request, :subscription_id, "15") %ExOnvif.Request{content: "content", namespaces: [], header: %ExOnvif.Request.Header{subscription_id: "15"}}