|
![]() |
#1 |
Участник
|
Спасибо за ответы.
Цитата:
Сообщение от Lucky13
![]() X++: WinInet winInet = new WinInet(...); //internetOpen вызывается в new int hURL; int hReq; int res; str ret; if (winInet.ok()) { hURL = winInet.internetConnect(servername,80); hReq = winInet.OpenRequest(hURL, url, 'POST'); res = winInet.SendRequest(hReq, hdr, data); ret = winInet.internetReadFile(hReq); } у меня нет методов winInet.OpenRequest и winInet.SendRequest. У меня есть winInet.httpSendRequest но у него порядок аргументов другой и один аргумент отличается X++: boolean httpSendRequest(int _handler, BinData _file, int _size) { return _httpSendRequest.call(_handler, "Content-Type: application/x-www-form-urlencoded", 47, _file, _size); } Последний раз редактировалось smailik; 08.12.2014 в 10:12. |
|
![]() |
#2 |
Участник
|
Цитата:
Примерно вот так: X++: _httpOpenRequest = new DLLFunction(_winInet, 'HttpOpenRequestA'); _httpOpenRequest.returns(ExtTypes::DWord); _httpOpenRequest.arg(ExtTypes::DWORD); _httpOpenRequest.arg(ExtTypes::String); _httpOpenRequest.arg(ExtTypes::String); _httpOpenRequest.arg(ExtTypes::String); _httpOpenRequest.arg(ExtTypes::String); _httpOpenRequest.arg(ExtTypes::DWORD); _httpOpenRequest.arg(ExtTypes::DWORD); _httpOpenRequest.arg(ExtTypes::DWORD); _httpSendRequest = new DLLFunction(_winInet, 'HttpSendRequestA'); _httpSendRequest.returns(ExtTypes::DWord); _httpSendRequest.arg(ExtTypes::DWord); _httpSendRequest.arg(ExtTypes::String); _httpSendRequest.arg(ExtTypes::DWord); _httpSendRequest.arg(ExtTypes::String); _httpSendRequest.arg(ExtTypes::DWord); int OpenRequest(int hdl, str _url, str _verb = "POST", int flags = 0) { ; return _httpOpenRequest.call(hdl, _verb, _url, '', '', 0, flags, 0); } int SendRequest(int handle, str hdr, str data) { ; return _httpSendRequest.call(handle, hdr, strlen(hdr), data, strlen(data)); } Последний раз редактировалось Lucky13; 08.12.2014 в 10:37. |
|
|
За это сообщение автора поблагодарили: smailik (1). |