---
title: "Custom HTTP Response Headers with Restlet"
author: "leng_cn"
date: "2011-08-30T15:41:42Z"
tags: []
categories: ["Web前端"]
slug: "custom-http-response-headers-with-restlet"
draft: false
lastmod: "2011-08-30T15:41:42Z"
id: 1161513
url: "https://leng.iteye.com/blog/1161513"
---

Form responseHeaders = (Form) getResponse().getAttributes().get("org.restlet.http.headers");
if (responseHeaders == null)
{
responseHeaders = new Form();
getResponse().getAttributes().put("org.restlet.http.headers", responseHeaders);
}
responseHeaders.add("X-Some-Header", "the value");