mirror of
https://github.com/lxsang/ant-http
synced 2024-12-27 09:18:22 +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();
|
dictionary d = dict();
|
||||||
dput(d,"test",c);
|
dput(d,"test",c);
|
||||||
dput(d,"test1","This is another cookie");
|
dput(d,"test1","This is another cookie");
|
||||||
set_cookie(client,d);
|
set_cookie(client,"text/html; charset=utf-8",d);
|
||||||
|
|
||||||
LOG("%s",c);
|
LOG("%s",c);
|
||||||
__t(client,"<h1>Set the cookie</h1>");
|
__t(client,"<h1>Set the cookie</h1>");
|
||||||
|
@ -237,10 +237,10 @@ int upload(const char* tmp, const char* path)
|
|||||||
{
|
{
|
||||||
return !rename(tmp, 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);
|
header_base(client);
|
||||||
__t(client,"Content-Type: text/html; charset=utf-8");
|
__t(client,"Content-Type: %s",type);
|
||||||
association assoc;
|
association assoc;
|
||||||
for_each_assoc(assoc,dic){
|
for_each_assoc(assoc,dic){
|
||||||
__t(client,"Set-Cookie: %s=%s",assoc->key, (char*)assoc->value);
|
__t(client,"Set-Cookie: %s=%s",assoc->key, (char*)assoc->value);
|
||||||
|
@ -57,7 +57,7 @@ char* htdocs(const char*);
|
|||||||
sqldb getdb();
|
sqldb getdb();
|
||||||
sqldb __getdb(char *name);
|
sqldb __getdb(char *name);
|
||||||
#endif
|
#endif
|
||||||
void set_cookie(int,dictionary);
|
void set_cookie(int, const char*,dictionary);
|
||||||
void clear_cookie(int, dictionary);
|
void clear_cookie(int, dictionary);
|
||||||
/*Default function for plugin*/
|
/*Default function for plugin*/
|
||||||
void handler(int, const char*,const char*,dictionary);
|
void handler(int, const char*,const char*,dictionary);
|
||||||
|
Loading…
Reference in New Issue
Block a user