예제 #1
0
// virtual
void  LLHTTPNode::options(ResponsePtr response, const LLSD& context) const
{
	//llinfos << "options context: " << context << llendl;

	// default implementation constructs an url to the documentation.
	std::string host = context[CONTEXT_REQUEST]["headers"]["host"].asString();
	if(host.empty())
	{
		response->status(400, "Bad Request -- need Host header");
		return;
	}
	std::ostringstream ostr;
	ostr << "http://" << host << "/web/server/api";
	ostr << context[CONTEXT_REQUEST]["path"].asString();
	static const std::string DOC_HEADER("X-Documentation-URL");
	response->addHeader(DOC_HEADER, ostr.str());
	response->status(200, "OK");
}
예제 #2
0
		void post(ResponsePtr r, const LLSD& context, const LLSD& input) const
			{ r->status(input["status"], input["reason"]); }
예제 #3
0
		void get(ResponsePtr r, const LLSD& context) const
			{ r->status(599, "Intentional error"); }