// 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"); }
void post(ResponsePtr r, const LLSD& context, const LLSD& input) const { r->status(input["status"], input["reason"]); }
void get(ResponsePtr r, const LLSD& context) const { r->status(599, "Intentional error"); }