website/docs/ddoc/data/handy_http_data.json.writeJ...

38 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>writeJsonBody (handy_http_data.json.writeJsonBody)</title>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<link href="style.css" rel="stylesheet" />
<script src="script.js" type="text/javascript"></script>
<link href="search-results.html" rel="prefetch" />
</head>
<body>
<div id="page-header">
<div id="logotype">
<span>Documentation</span>
<nav>
<a href="http://dlang.org/">Dlang.org</a>
</nav>
</div>
<form action="search-docs.html" id="search">
<input name="searchTerm" placeholder="Find a symbol name..." type="search" />
<input type="submit" value="Go" />
</form>
</div>
<div id="page-body">
<div id="page-content">
<h1>writeJsonBody</h1><div class="breadcrumbs"><a class="breadcrumb" href="handy_http_data.html">handy_http_data</a> <a class="breadcrumb" href="handy_http_data.json.html">json</a> </div><div><div class="documentation-comment synopsis"><div><p>Writes a JSON value to the body of the given HTTP response, serializing it
using the ASDF library. Will also set Content-Type and Content-Length
headers before writing.</p><p>Throws an INTERNAL_SERVER_ERROR HttpStatusException if serialization or
writing fails.</p></div></div></div><div class="annotated-prototype"><div class="function-prototype"><div class="attributes"></div><div class="return-type"><span class="builtin-type">void</span></div><div class="function-name">writeJsonBody</div><div class="template-parameters" data-count="1">(<div class="parameters-list toplevel"><div class="template-parameter-item parameter-item"> <span><span class="name" data-ident="T">T</span></span></div></div>)</div><div class="runtime-parameters" data-count="2"><div class="parameters-list toplevel"><span class="paren">(</span><div class="runtime-parameter-item parameter-item"><span class="parameter-type-holder"><span class="parameter-type"><span class="storage-class">ref</span> <span class="name" data-ident="ServerHttpResponse">ServerHttpResponse</span></span></span> <span class="parameter-name name" data-ident="response"><a href="#param-response">response</a></span></div><span class="comma">,</span><div class="runtime-parameter-item parameter-item"><span class="parameter-type-holder"><span class="parameter-type"><span class="storage-class">in</span> <span class="name" data-ident="T">T</span></span></span> <span class="parameter-name name" data-ident="bodyContent"><a href="#param-bodyContent">bodyContent</a></span></div><span class="paren">)</span></div></div><div class="function-contracts"></div></div></div><div><h2 id="parameters"><a class="header-anchor" href="#parameters">Parameters</a></h2><dl class="parameter-descriptions"><dt id="param-response"><a class="parameter-name" data-ident="response" href="#param-response">response</a> <span class="parameter-type"><span class="name" data-ident="ServerHttpResponse">ServerHttpResponse</span></span></dt><dd><div class="documentation-comment"><div><p>The response to write to.</p></div></div></dd><dt id="param-bodyContent"><a class="parameter-name" data-ident="bodyContent" href="#param-bodyContent">bodyContent</a> <span class="parameter-type"><span class="name" data-ident="T">T</span></span></dt><dd><div class="documentation-comment"><div><p>The content to write.</p></div></div></dd></dl></div></div>
<div id="page-nav"><a class="parent" href="handy_http_data.html">handy_http_data</a> <a class="parent" href="handy_http_data.json.html">json</a>
<span class="type-separator">functions</span><ul><li><a class="function" href="handy_http_data.json.readJsonBodyAs.html">readJsonBodyAs</a></li><li><a class="function current" href="handy_http_data.json.writeJsonBody.html">writeJsonBody</a></li></ul></div>
</div>
<div id="page-footer">Page generated by <a href="https://github.com/adamdruppe/adrdox">adrdox</a></div>
</body>
</html>