Mais conteúdo relacionado
Http
- 5. GET
GET / HTTP/1.1
Connection: KeepAlive
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.1
(KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1
Accept: text/*, image/jpeg, image/png, image/*, */*
AcceptEncoding: xgzip, gzip, identity
AcceptCharset: Any, utf8, *
AcceptLanguage: en, en_US
Host: www.google.com
- 9. CGI
http://example.com/toplama.cgi?m=4&n=2
...
HTTP_ACCEPT="text/html,application/xhtml+xml,application/xml;q=0
.9,*/*;q=0.8"
HTTP_ACCEPT_CHARSET="ISO88591,utf8;q=0.7,*;q=0.7"
HTTP_ACCEPT_ENCODING="gzip, deflate"
HTTP_ACCEPT_LANGUAGE="enus,en;q=0.5"
HTTP_CONNECTION="keepalive"
HTTP_HOST="example.com"
HTTP_USER_AGENT="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0)
Gecko/20100101 Firefox/5.0"
...
QUERY_STRING="var1=value1&var2=with%20percent%20encoding"
REMOTE_ADDR="127.0.0.1"
REMOTE_PORT="63555"
REQUEST_METHOD="GET"
REQUEST_URI="/toplama.cgi?m=4&n=2"
...
- 10. CGI
http://example.com/toplama.cgi?m=4&n=2
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char *data;
long m,n;
printf("%s%c%cn", "ContentType:text/html;charset=utf
8",13,10);
printf("<p>Toplama</p>n");
data = getenv("QUERY_STRING");
sscanf(data,"m=%ld&n=%ld",&m,&n);
printf("<p> %ld + %ld = %ld.",m,n,m*n);
return 0;
}
- 12. İstinadlar
● RFC 2616 (http://tools.ietf.org/html/rfc2616)
● RFC 3875 (http://tools.ietf.org/html/rfc3875)