09.12.2014, 15:53 | #22 |
Участник
|
X++: webRequest = System.Net.WebRequest::Create("http://review.maxoptra.com"); webRequest.set_Method("POST"); postData = "http://review.maxoptra.com/rest/2/authentication/createSession?accountID=XXX&user=XXX&password=XXX"; //postData = ""; encodingUTF8 = System.Text.Encoding::get_UTF8(); // пробовал другие кодировки byteArray = encodingUTF8.GetBytes(postData); leng = byteArray.get_Length(); // длина соответствует длине postData webRequest.set_ContentType("application/x-www-form-urlencoded"); webRequest.set_ContentLength(byteArray.get_Length()); //credentialCache = System.Net.CredentialCache::get_DefaultCredentials(); ОК <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="shortcut icon" href="/mxm/favicon.ico" type="image/x-icon"/> <script type="text/javascript" src="/mxm-commons/commons/app-template.js" charset="utf-8"></script> <script type="text/javascript" src="/mxm/mxm-api/file/app-template.js" charset="utf-8"></script> <script type="text/javascript"> var application = null; var MX_DIR = "/mxm/"; var MXM_DIR = "/mxm/"; var MX_DEBUG_MODE = false; </script> <link rel="stylesheet" type="text/css" href="/mxm-commons/ext/resources/css/ext-all.css?3.3.1.GT rev:49875"/> <link rel="stylesheet" type="text/css" href="/mxm-commons/packed/commons-main.css?3.3.1.GT rev:49875"/> <script type="text/javascript" src="/mxm-commons/ext/adapter/ext/ext-base.js?3.3.1.GT rev:49875"></script> <script type="text/javascript" src="/mxm-commons/ext/ext-all/ext-all.js?3.3.1.GT rev:49875"></script> <script type="text/javascript" src="/mxm-commons/packed/commons-main.js?3.3.1.GT rev:49875"></script> <script type="text/javascript" src="/mxm-commons/packed/commons-login-form.js?3.3.1.GT rev:49875"></script> <script type="text/javascript" src="/mxm-commons/packed/commons.js?3.3.1.GT rev:49875"></script> <title>Maxoptra Management Application [3.3.1.GT rev:49875]</title> <script type="text/javascript"> eventManager = new mx.app.widget.EventManager(); Ext.onReady(function () { application = new mx.Application(); }); </script> </head> <body> <form id="history-form" class="x-hidden" action=""> <input type="hidden" id="x-history-field"/> <iframe id="x-history-frame"></iframe> </form></body> </html> может в какой-то тонкости хитрость? проверял запрос из postData в Google Chrome в расширении Advanced Rest Client все красиво, отвечает <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <apiResponse version="1.0"> <authResponse> <sessionID>01c98206543e491f85905c4723e12432</sessionID> </authResponse> </apiResponse> Последний раз редактировалось smailik; 09.12.2014 в 15:57. |
|