summaryrefslogtreecommitdiff
path: root/indra/llmessage/llhttpsender.h
blob: 0ba8e309452e424f4b45a63e483e8247db3fda7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/** 
 * @file llhttpsender.h
 * @brief Abstracts details of sending messages via HTTP.
 *
 * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
 * $License$
 */

#ifndef LL_HTTP_SENDER_H
#define LL_HTTP_SENDER_H

#include "llhttpclient.h"

class LLHost;
class LLSD;

class LLHTTPSender
{
 public:

	virtual ~LLHTTPSender();

	/** @brief Send message to host with body, call response when done */ 
	virtual void send(const LLHost& host, 
					  const char* message, const LLSD& body, 
					  LLHTTPClient::ResponderPtr response) const;

	/** @brief Set sender for host, takes ownership of sender. */
	static void setSender(const LLHost& host, LLHTTPSender* sender);

	/** @brief Get sender for host, retains ownership of returned sender. */
	static const LLHTTPSender& getSender(const LLHost& host);
	
	/** @brief Clear sender for host. */
	static void clearSender(const LLHost& host);

	/** @brief Set default sender, takes ownership of sender. */
	static void setDefaultSender(LLHTTPSender* sender);
};

#endif // LL_HTTP_SENDER_H