Mercurial > hg > orthanc
diff 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 |
line wrap: on
line diff
--- a/Core/Lua/LuaContext.h Wed Jul 23 12:59:28 2014 +0200 +++ b/Core/Lua/LuaContext.h Wed Jul 23 15:08:09 2014 +0200 @@ -56,9 +56,17 @@ static LuaContext& GetLuaContext(lua_State *state); - static int PrintToLog(lua_State *L); + static int PrintToLog(lua_State *state); - static int CallHttpGet(lua_State *L); + static int CallHttpPostOrPut(lua_State *state, + HttpMethod method); + static int CallHttpGet(lua_State *state); + static int CallHttpPost(lua_State *state); + static int CallHttpPut(lua_State *state); + static int CallHttpDelete(lua_State *state); + + bool DoHttpQuery(lua_State* state, + bool isJson); void Execute(std::string* output, const std::string& command); @@ -84,5 +92,11 @@ void Execute(EmbeddedResources::FileResourceId resource); bool IsExistingFunction(const char* name); + + void SetHttpCredentials(const char* username, + const char* password) + { + httpClient_.SetCredentials(username, password); + } }; }