mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 00:38:21 +01:00
support json cookie
This commit is contained in:
parent
bd8ed530b9
commit
5ebe581ea3
BIN
._Makefile
BIN
._Makefile
Binary file not shown.
@ -18,7 +18,7 @@ void execute(int client,const char* method,dictionary rq)
|
||||
dictionary d = dict();
|
||||
dput(d,"test",c);
|
||||
dput(d,"test1","This is another cookie");
|
||||
set_cookie(client,d);
|
||||
set_cookie(client,"text/html; charset=utf-8",d);
|
||||
|
||||
LOG("%s",c);
|
||||
__t(client,"<h1>Set the cookie</h1>");
|
||||
|
@ -237,17 +237,17 @@ int upload(const char* tmp, const char* path)
|
||||
{
|
||||
return !rename(tmp, path);
|
||||
}
|
||||
void set_cookie(int client,dictionary dic)
|
||||
void set_cookie(int client,const char* type, dictionary dic)
|
||||
{
|
||||
header_base(client);
|
||||
__t(client,"Content-Type: text/html; charset=utf-8");
|
||||
__t(client,"Content-Type: %s",type);
|
||||
association assoc;
|
||||
for_each_assoc(assoc,dic){
|
||||
__t(client,"Set-Cookie: %s=%s",assoc->key, (char*)assoc->value);
|
||||
}
|
||||
response(client,"");
|
||||
}
|
||||
void clear_cookie(int client, dictionary dic)
|
||||
void clear_cookie(int client, dictionary dic)
|
||||
{
|
||||
header_base(client);
|
||||
__t(client,"Content-Type: text/html; charset=utf-8");
|
||||
|
@ -57,7 +57,7 @@ char* htdocs(const char*);
|
||||
sqldb getdb();
|
||||
sqldb __getdb(char *name);
|
||||
#endif
|
||||
void set_cookie(int,dictionary);
|
||||
void set_cookie(int, const char*,dictionary);
|
||||
void clear_cookie(int, dictionary);
|
||||
/*Default function for plugin*/
|
||||
void handler(int, const char*,const char*,dictionary);
|
||||
|
Loading…
Reference in New Issue
Block a user