ÃÑ ÆäÀÌÁö ¼ö : 3224
![]()
|
Facebook Joinc ±×·ì
Joinc QA »çÀÌÆ®
![]()
Tweet
joinc´Â Firefox¿Í chrome¿¡¼ Å×½ºÆ® Çß½À´Ï´Ù. IE¿¡¼´Â Å×À̺íÀÌ ±úÁö°Å³ª À̹ÌÁö°¡ º¸ÀÌÁö ¾ÊÀ» ¼ö ÀÖ½À´Ï´Ù. ƯÈ÷ ±¸±Û DocsÀ̹ÌÁöÀÇ °æ¿ì ¿¢¹Úó¸®µÉ ¼ö ÀÖ½À´Ï´Ù.
Describe Site/Web/documents/libwww/Sample/GetDoc here
HTTP(12) ¹®¼¸¦ ÀоîµéÀδÙ. Makefile(12)Àº GetLink¸¦ ÂüÁ¶ÇÑ´Ù.
ÀÌ ÇÁ·Î±×·¥Àº Header¸¦ Æ÷ÇÔÇØ¼ ÇØ´ç URLÀÇ ¸ðµç Á¤º¸¸¦ Àоîµé¿©¼ ȸ鿡 Ãâ·ÂÇÑ´Ù. ¸¸¾à Header¸¦ Á¦¿ÜÇÑ ³»¿ëÀ» ÀоîµéÀÌ±æ ¿øÇÑ´Ù¸é HTRequest_setOutputFormat(request, WWW_RAW); ¿¡¼ WWW_RAW¸¦ WWW_SOURCE·Î ¹Ù²Ù¸é µÈ´Ù.
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <WWWLib.h>
#include <WWWHTTP.h>
#include <WWWInit.h>
PRIVATE int terminate_handler(HTRequest *request, HTResponse *response,
void *parm, int status)
{
HTPrint("Load result in status %d\n", status);
HTEventList_stopLoop();
return HT_ERROR;
}
int main(int argc, char **argv)
{
HTRequest *request = HTRequest_new();
HTChunk *chunk = NULL;
char *url = argc == 2? argv[1] : NULL;
HTProfile_newPreemptiveClient("TestApp", "1.0");
/*
HTPrint_setCallback(printer);
HTPrint_setCallback(tracer);
*/
HTRequest_setOutputFormat(request, WWW_RAW);
HTRequest_addConnection(request, "close", "");
HTNet_addAfter(terminate_handler, NULL, NULL, HT_ALL, HT_FILTER_LAST);
if (url)
{
char *cwd = HTGetCurrentDirectoryURL();
char *absolute_url = HTParse(url, cwd, PARSE_ALL);
chunk = HTLoadToChunk(absolute_url, request);
HT_FREE(absolute_url);
HT_FREE(cwd);
if (chunk)
{
char *string;
HTEventList_loop(request);
string = HTChunk_toCString(chunk);
HTPrint("%s", string ? string : "no text");
HT_FREE(string);
}
else
{
HTPrint("Type the URL you want to access on the command line\n");
}
}
HTRequest_delete(request);
HTProfile_delete();
return 0;
}
|
|
|
EmailÀ» ±âÀÔÇϸé, ´ñ±ÛÀÌ ¸ÞÀÏ·Î Àü´ÞµË´Ï´Ù. |
|