comparison Core/Lua/LuaContext.h @ 1052:cc4ff680e2a0

http requests in lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Jul 2014 15:08:09 +0200
parents 92f4bf2c5d73
children 6f923d52a46c
comparison
equal deleted inserted replaced
1051:92f4bf2c5d73 1052:cc4ff680e2a0
54 std::string log_; 54 std::string log_;
55 HttpClient httpClient_; 55 HttpClient httpClient_;
56 56
57 static LuaContext& GetLuaContext(lua_State *state); 57 static LuaContext& GetLuaContext(lua_State *state);
58 58
59 static int PrintToLog(lua_State *L); 59 static int PrintToLog(lua_State *state);
60 60
61 static int CallHttpGet(lua_State *L); 61 static int CallHttpPostOrPut(lua_State *state,
62 HttpMethod method);
63 static int CallHttpGet(lua_State *state);
64 static int CallHttpPost(lua_State *state);
65 static int CallHttpPut(lua_State *state);
66 static int CallHttpDelete(lua_State *state);
67
68 bool DoHttpQuery(lua_State* state,
69 bool isJson);
62 70
63 void Execute(std::string* output, 71 void Execute(std::string* output,
64 const std::string& command); 72 const std::string& command);
65 73
66 void PushJson(const Json::Value& value); 74 void PushJson(const Json::Value& value);
82 } 90 }
83 91
84 void Execute(EmbeddedResources::FileResourceId resource); 92 void Execute(EmbeddedResources::FileResourceId resource);
85 93
86 bool IsExistingFunction(const char* name); 94 bool IsExistingFunction(const char* name);
95
96 void SetHttpCredentials(const char* username,
97 const char* password)
98 {
99 httpClient_.SetCredentials(username, password);
100 }
87 }; 101 };
88 } 102 }