Axis APPINT Podręcznik integracji - Strona 7

Przeglądaj online lub pobierz pdf Podręcznik integracji dla Serwer Axis APPINT. Axis APPINT 10 stron. Application integration

2. Create an HTTP handle by calling the InternetConnect function with the
necessary parameters:
HINTERNET anHTTPHandle =
InternetConnect(anInetHandle,
3. Use the HTTP handle to open a request. The second parameter indicates that it is
a
request and the third indicates that the target is the '/user/scan/scan.shtml'
page. By default, redirect responses are handled automatically:
HINTERNET anHttpRequest =
HttpOpenRequest(anHTTPHandle,
4. Add an HTTP header which informs the HTTP server that the request contains
encoded data:
char aReqStr[] =
"Content-type: application/x-www-form-urlencoded";
HttpAddRequestHeaders(anHttpRequest,
5. Create a query string containing the parameters you want to send and send the
request:
char aQeryStr[] =
"\n\npage=scan&profileName=Color+low&scanNow=";
HttpSendRequest(anHttpRequest,
"171.16.1.185",
INTERNET_DEFAULT_HTTP_PORT,
"root",
"pass",
INTERNET_SERVICE_HTTP,
0,
0);
"POST",
"/user/scan/scan.shtml",
NULL,
NULL,
NULL,
0,
0);
aReqStr,
strlen(aReqStr),
0)
0,
0,
aQeryStr,
strlen(aQeryStr))
7