So:
[autoit]$post = "os_username=" & $username & "&os_password=" & $password
[/autoit]So:
[autoit]$post = "os_username=" & $username & "&os_password=" & $password
[/autoit]nope, worked nich
Habe es bei einer Seite von mir genutzt, so hat es geklappt.
Habe die Adresse mit http Live Headers ausgelesen (Firefox Addon)
$hRequest = _WinHttpOpenRequest($hConnect, "POST", "/login.php", "HTTP/1.1")
_WinHttpSendRequest($hRequest, "Content-Type: application/x-www-form-urlencoded" & @CRLF, "loginName=" & $User & "&loginPwd=" &$password & "&btnLogin=Anmelden")
funktioniert angepasst auch nicht wirklich.
hiermal der quelltext der HP:
<!DOCTYPE html>
<html>
<head>
<title>Anmelden - Confluence</title>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE,chrome=IE7">
<meta charset="UTF-8">
<!-- Deprecated since 3.4. To be removed in a future version of Confluence; use AJS.Confluence.getContextPath() -->
<meta id="confluence-context-path" name="confluence-context-path" content="">
<meta id="confluence-base-url" name="confluence-base-url" content="https://wiki.inserve.local">
<meta id="atlassian-token" name="atlassian-token" content="ac37c562976e1761007056796e4d9be299a00929">
<script type="text/javascript">
// Deprecated global variables. To be removed in a future version of Confluence.
var contextPath = '';
</script>
<!-- include system css resources -->
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/59/_/download/superbatch/css/batch.css" media="all">
<!--[if lt IE 9]>
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/59/_/download/superbatch/css/batch.css?conditionalComment=lt+IE+9" media="all">
<![endif]-->
<!--[if IE 9]>
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/59/_/download/superbatch/css/batch.css?conditionalComment=IE+9" media="all">
<![endif]-->
<!--[if lte IE 9]>
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/59/_/download/superbatch/css/batch.css?conditionalComment=lte+IE+9" media="all">
<![endif]-->
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/59/_/download/superbatch/css/batch.css?media=print" media="print">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/ede572eb7cb06982fd2993d08a8644fc/_/download/contextbatch/css/main,atl.general/batch.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/1.0/_/download/batch/confluence.web.resources:aui-forms/confluence.web.resources:aui-forms.css" media="all">
<!--[if lt IE 9]>
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/1.0/_/download/batch/confluence.web.resources:aui-forms/confluence.web.resources:aui-forms.css?conditionalComment=lt+IE+9" media="all">
<![endif]-->
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/3.0.4/_/download/batch/com.refinedwiki.confluence.plugins.theme.original:utils/com.refinedwiki.confluence.plugins.theme.original:utils.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/11/_/styles/colors.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/3.0.4/_/download/resources/com.refinedwiki.confluence.plugins.theme.original:RefinedWikiTheme40/default-theme.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/3.0.4/_/download/resources/com.refinedwiki.confluence.plugins.theme.original:RefinedWikiTheme40/originaltheme.base.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/3.0.4/_/download/resources/com.refinedwiki.confluence.plugins.theme.original:RefinedWikiTheme40/originaltheme.c40.css" media="all">
<link type="text/css" rel="stylesheet" href="/s/de_DE/3143/11/11/_/styles/theme-colors.css?completeModuleKey=com.refinedwiki.confluence.plugins.theme.original%3ARefinedWikiTheme40&stylesheetName=originaltheme.colors.css" media="all">
<!-- end system css resources -->
<meta name="robots" content="noindex,nofollow">
<meta name="robots" content="noarchive">
<meta name="confluence-request-time" content="1330703164274">
<meta name="ajs-context-path" content="">
<meta name="ajs-version-number" content="4.1.5">
<meta name="ajs-build-number" content="3143">
<meta name="ajs-remote-user" content="">
<meta name="ajs-static-resource-url-prefix" content="/s/en_GB/3143/11/_">
<meta name="ajs-global-settings-attachment-max-size" content="8000485760">
<meta name="ajs-user-locale" content="de_DE">
<meta name="ajs-enabled-dark-features" content="">
<meta name="ajs-atl-token" content="ac37c562976e1761007056796e4d9be299a00929">
<meta name="ajs-use-keyboard-shortcuts" content="true">
<meta name="ajs-keyboardshortcut-hash" content="542119f8710f3edbbe3210d947828be0">
<!-- Deprecated since 3.4. To be removed in a future version of Confluence; use atl.header -->
<script type="text/x-template" title="share-content-popup">
<form action="#" method="post" class="aui share-content-popup">
<fieldset>
<label for="users">Benutzername oder E-Mail-Adresse</label>
<div class="autocomplete-user-target">
<input class="text autocomplete-sharepage" id="users" data-max="10" data-dropdown-target=".autocomplete-user-target" data-none-message="Kein Benutzer gefunden"/>
</div>
<ol class="recipients">
</ol>
<div><label for="note">Nachricht</label></div>
<textarea class="textarea" id="note" placeholder="Optionale Nachricht"/>
</fieldset>
<div class="button-panel">
<div class="progress-messages-icon"></div>
<div class="progress-messages">
</div>
<input class="button submit" type="submit" value="Teilen" disabled/>
<a class="close-dialog" href="#">Abbrechen</a>
</div>
</form>
</script>
<script type="text/x-template" title="share-content-popup-recipient-username">
<li data-username="{username}" style="display: none">
<span>
<img src="{thumbnailLink.href}" title="{title}">
<span>{title}</span>
<span class="remove-recipient"/>
</span>
</li>
</script>
<script type="text/x-template" title="share-content-popup-recipient-email">
<li data-email="{email}" style="display: none">
<span>
<img src="{icon}" title="{email}">
<span>{email}</span>
<span class="remove-recipient"/>
</span>
</li>
</script>
<script type="text/x-template" title="gliffy-footer-webpanel">
<div class="gliffy-footer-webpanel"><span></span></div>
</script>
<link rel="shortcut icon" href="/favicon.ico">
<link rel="icon" type="image/png" href="/s/en_GB/3143/11/_/images/logo/confluence_16_white.png">
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch/osd.action" title="Confluence"/>
<!-- include system javascript resources -->
<script type="text/javascript" src="/s/de_DE/3143/11/59/_/download/superbatch/js/batch.js" ></script>
<!--[if lte IE 8]>
<script type="text/javascript" src="/s/de_DE/3143/11/59/_/download/superbatch/js/batch.js?conditionalComment=lte+IE+8" ></script>
<![endif]-->
<script type="text/javascript" src="/s/de_DE/3143/11/ede572eb7cb06982fd2993d08a8644fc/_/download/contextbatch/js/main,atl.general/batch.js" ></script>
<script type="text/javascript" src="/s/de_DE/3143/11/1.0/_/download/batch/confluence.web.resources:login/confluence.web.resources:login.js" ></script>
<script type="text/javascript" src="/s/de_DE/3143/11/3.0.4/_/download/batch/com.refinedwiki.confluence.plugins.theme.original:utils/com.refinedwiki.confluence.plugins.theme.original:utils.js" ></script>
<script type="text/javascript" src="/s/de_DE/3143/11/3.0.4/_/download/batch/com.refinedwiki.confluence.plugins.theme.original:base-scripts/com.refinedwiki.confluence.plugins.theme.original:base-scripts.js" ></script>
<!-- end system javascript resources -->
<script>
if (typeof originalTheme === 'undefined') {
var originalTheme = {};
}
originalTheme.searchTitle = 'Suchen';
var contextPath = '';
originalTheme.notLoggedIn = 'Nicht angemeldet';
originalTheme.categoryDropDownEnabled = true;
originalTheme.categoryDropDownLayout = 'multi_column';
originalTheme.scrollSearchActive = true;
</script>
<!--[if !IE]><!-->
<style type="text/css">
.rw_toolbar_menu li .rw_toolbar_dropdown li a:hover
{
color: #ffffff;
background: #6699cc;
}
/* Scroll office fix */
#com-k15t-confluence-scroll-pdf-launcher:hover
{
color: #ffffff;
background: #6699cc;
}
</style>
<!--<![endif]-->
<!--[if IE 6]>
<link type="text/css" rel="stylesheet" href="/download/resources/com.refinedwiki.confluence.plugins.theme.original/styles/ie6-fix.css" media="all"/>
<![endif]-->
<!--[if IE 7]>
<link type="text/css" rel="stylesheet" href="/download/resources/com.refinedwiki.confluence.plugins.theme.original/styles/ie7-fix.css" media="all"/>
<![endif]-->
<link type="text/css" rel="stylesheet" href="/download/resources/com.refinedwiki.confluence.plugins.theme.original/styles/designs/original/style.css" media="all"/>
<style type="text/css">
#rw_wrapper #rw_main_top_left
{
background:#DC241F url(/download/resources/com.refinedwiki.confluence.plugins.theme.original/images/designs/fade_light_original.png) repeat-x;
border:1px solid #DC241F;
border-bottom:0px;
-moz-border-radius-topleft:10px;
-moz-border-radius-topright:10px;
-webkit-border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
}
#rw_wrapper #rw_main_top_right{padding-bottom:0px; background:none;}
#rw_wrapper #rw_main_middle_left
{
background:#DC241F;
padding-left:9px;
padding-right:9px;
border-left:1px solid DC241F;
border-right:1px solid DC241F;
}
#rw_wrapper #rw_main_middle_right
{
padding:10px;
background:#ffffff;
-moz-border-radius:6px;
-webkit-border-radius:6px;
}
#rw_wrapper #rw_main_bottom_left
{
background:#DC241F;
border:1px solid #DC241F;
border-top:0px;
-moz-border-radius-bottomleft:10px;
-moz-border-radius-bottomright:10px;
-webkit-border-bottom-left-radius:10px;
-webkit-border-bottom-right-radius:10px;
height:10px;
}
#rw_wrapper #rw_main_bottom_right
{
height:10px;
background:none;
}
</style>
</head>
<body onload="placeFocus()"
id="com-atlassian-confluence" class="RefinedWikiTheme40 login">
<ul id="assistive-skip-links" class="assistive">
<li><a href="#title-heading">Zu Inhalt springen</a></li>
<li><a href="#breadcrumbs">Zu Breadcrumbs springen</a></li>
<li><a href="#header-menu-bar">Zu Überschriftmenü springen</a></li>
<li><a href="#navigation">Zu Aktionsmenü springen</a></li>
<li><a href="#quick-search-query">Zu Schnellsuche springen</a></li>
</ul>
<div id="page">
<div id="full-height-container">
<div id="header-precursor">
</div>
<div id="rw_wrapper" >
<div id="rw_main">
<div id="rw_sticky_bar" class="show_on_scroll rw_no_print" style="display:none;">
<div id="rw_sticky_bar_top">
<div id="rw_search_container_sticky_bar"></div>
</div>
<div id="rw_sticky_bar_bottom" >
<div class="rw_show_hide_sticky">
<a id="rw_sticky_bar_show" class="rw_sticky_bar_button" title="Anzeigen ( Typ '/' )" >
<span class="rw_icon_container_20 rw_sticky_bar"></span>
</a>
<a id="rw_sticky_bar_hide" class="rw_sticky_bar_button_active" style="display:none;" title="Verbergen ( Typ 'esc' )">
<span class="rw_icon_container_20 rw_sticky_bar"></span>
</a>
</div>
</div>
</div>
<div id="rw_no_logo_spacer" class="rw_no_print">
</div>
<div style="clear:both"></div>
<div id="rw_main_top_left" class="rw_no_print">
<div id="rw_main_top_right" class="rw_no_print" >
<div class="rw_box" id="original_top_content">
<div id="rw_search_container">
<div id="rw_search">
<form style="width:0px; height:0px; overflow:hidden; "><input type="text" name="hack" onfocus="this.blur()" /></form>
<form id="rw_search_form" class="rw_search_form" method="get" action="/dosearchsite.action">
<input class="rw_search_query" id="rw_search_query" type="text" accessKey="search-pages-action.accesskey" autocomplete="off" name="queryString" size="25" />
<div style="clear:both;"></div>
<div id="rw_search_result_container" class="rw_search_result_container" style="display:none;">
</div>
<fieldset class="hidden parameters">
<input type="hidden" id="quickNavEnabled" value="true" />
</fieldset>
</form>
<script type="text/x-template" id="rw_search_item">
<li>
<a>
<span class="rw_search_item_title"></span>
<span class="rw_search_item_space"></span>
</a>
</li>
</script>
<script type="text/x-template" id="rw_search_section">
<ul>
</ul>
</script>
</div>
</div>
<div id="rw_breadcrumb">
<table height="40px"><tr><td>
</td></tr></table>
</div>
</div>
<div id="rw_category_menu">
<ul>
<li class="rw_first">
<a
href="/dashboard.action"
onclick="window.location='/dashboard.action';return false;"
title="Übersicht ( Type 'n' )"
>
<span class="rw_item_left">
<span>Übersicht</span>
</span>
<span class="rw_item_right"></span>
</a>
</li>
</ul>
</div>
<div id="rw_category_dropdown_wrapper" class="rw_popup" style="display:none;">
<div id="rw_category_dropdown_container" class="rw_popup_container"></div>
<div id="rw_category_dropdown_loader" class="rw_popup_loader">
<img src="/download/resources/com.refinedwiki.confluence.plugins.theme.original/images/ajax-loader-gray.gif" />
</div>
</div>
</div> <!-- rw_main_top_right -->
</div> <!-- rw_main_top_left -->
<div id="rw_main_middle_left">
<div id="rw_main_middle_right">
<div id="rw_menu_bar">
<div id="rw_toolbar">
<ul id="browse_and_user_menu" class="rw_toolbar_menu" >
<li class="toolbar-dropdown-menu-item">
<a id="browse-menu-link" class="rw_toolbar_dropdown_button browse" href="#"><span>Durchsuchen</span></a> <div style="clear: both;"></div>
<div class="ajs-drop-down rw_toolbar_dropdown browse" >
<ul id="browse-menu-link-global"
class="section-global first ">
<li>
<a id="whats-new-menu-link" href="http://docs.atlassian.com/confluence/docs-41/whatsnew/iframe" title=""
>
<span
class="" ><nobr>Was ist neu</nobr></span> </a>
</li>
<li>
<a id="tagcloud-link" href="/labels/tagcloud.action" title="Show most popular tags"
>
<span
class="" ><nobr>Global Tagcloud</nobr></span> </a>
</li>
<li>
<a id="space-directory-link" href="/spacedirectory/view.action" title="Verzeichnis der Confluence-Bereiche durchsuchen"
>
<span
class="" ><nobr>Bereichsverzeichnis</nobr></span> </a>
</li>
<li>
<a id="feed-builder-link" href="/dashboard/configurerssfeed.action" title="Kundenspezifischen RSS-Feed erstellen"
>
<span
class="" ><nobr>Feed-Builder</nobr></span> </a>
</li>
<li>
<a id="keyboard-shortcuts-link" title="Verfügbare Tastenkombinationen anzeigen"
>
<span
class="" ><nobr>Tastenkombinationen</nobr></span> </a>
</li>
<li>
<a id="gadget-directory-link" title="Von Confluence bereitgestellte Gadgets durchsuchen"
>
<span
class="user-item administration-link" ><nobr>Confluence Gadgets</nobr></span> </a>
</li>
</ul>
</div>
</li>
<li class="test-ajs-menu-item normal">
<a id="login-link" href="/login.action" title=""
>
<span
class="user-item login-link" ><nobr>Anmelden</nobr></span> </a>
</li>
</ul>
</div>
<a href="/dashboard.action" title='Übersicht' class="rw_menu_back"><span></span></a>
<h1 id="title-heading" class="pagetitle">
<span>
<a href="/homepage.action">Confluence</a>
</span>
</h1>
</div> <!-- rw_menu_bar -->
<div style="clear:both;"></div>
<div id="main" >
<div id="sidebar-container">
</div><!-- \#sidebar-container -->
<div id="login-container">
<form name="loginform" method="POST" action="/dologin.action" class="aui login-form-container">
<fieldset class="compact-form-fields">
<legend class="assistive"><span>Bei Confluence anmelden</span></legend>
<div class="field-group
">
<label id="os_username-label" for="os_username">
<u>B</u>enutzername
</label>
<input type="text" name="os_username" id="os_username" class="text " data-focus="0" />
</div>
<div class="field-group">
<label id="os_password-label" for="os_password">
<u>P</u>asswort
</label>
<input type="password" name="os_password" id="os_password" class="password " />
</div>
<div class="group">
<div class="checkbox">
<input type="checkbox" class="checkbox" value="true" name="os_cookie"
id="os_cookie">
<label for="os_cookie">Meinen <u>L</u>ogin an diesem Computer speichern</label>
</div>
</div>
<div class="field-group form-buttons compact-form-buttons">
<input id="loginButton" name="login" type="submit" value="Anmelden" />
<a id="forgot-password" href="/forgotuserpassword.action">Passwort vergessen</a>
</div>
<input type="hidden" name="os_destination" value="/homepage.action"/>
</fieldset>
</form> </div>
<div id="login-language" >
<a href="login.action?language=de_DE">Deutsch</a>
<a href="login.action?language=en_GB">English</a>
<a href="login.action?language=fr_FR">Français</a>
</div>
<br class="clear">
</div><!-- \#main -->
</div> <!-- rw_main_middle_right -->
</div> <!-- rw_main_middle_left -->
<div id="rw_main_bottom_left">
<div id="rw_main_bottom_right">
</div>
</div>
<div id="rw_footer">
Powered by <a href="http://www.atlassian.com/software/confluence" title="Atlassian Confluence" target="_blank">Atlassian Confluence</a>, <a href="http://www.refinedwiki.com" title="RefinedWiki" target="_blank" > a Confluence theme by RefinedWiki</a>
</div>
</div> <!-- rw_main -->
</div><!-- rw_wrapper -->
<script type="text/javascript" >
AJS.toInit(function ($) {
//improve the pagetree functionality: "selected" class at selected page and expand the children of selected page
//first save the original pagetree function "origHideEmptyChildrenContainer"
var origHideEmptyChildrenContainer = AJS.pagetree.hideEmptyChildrenContainers;
//define our own one and overwrite the original pagetree function "hideEmptyChildrenContainers"
//this function is called by the pagetree after children loading
AJS.pagetree.hideEmptyChildrenContainers = function(pagetreeChildrenDiv) {
//search for the child element with the style attribute
pagetreeChildrenDiv.find('span.plugin_pagetree_children_span').each(function(){
if(jQuery(this).attr('style')) {
//add a marker for the seleted page... now we can style it with css
jQuery(this).addClass("selected");
//click on the plus icon to expand the children of the current page
jQuery(this).parent().parent().find('.plugin_pagetree_childtoggle_container a.icon-plus').trigger('click');
}
});
//call the saved original function...
origHideEmptyChildrenContainer(pagetreeChildrenDiv);
};
});
</script>
</div><!-- \#full-height-container -->
</div><!-- \#page -->
</body>
</html>
brauchst keinen quelltext sondern den http request
Accept */*
Accept-Encoding gzip, deflate
Accept-Language de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection keep-alive
Content-Length 26
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Cookie JSESSIONID=46B3742107DE4EB000098B31806FAAC2
Host wiki.inserve.local
Referer https://wiki.inserve.local/display/MEINUSERNAME/Willkommen
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
X-Requested-With XMLHttpRequest
Kev,
du mußt den Login-Vorgang mit http Live Headers mitschneiden, dann hast du die Infos im Header welche du benötigst )
Wenn du auf Generator gehst (bei Live http header) siehst du den Befehl
Es will nicht...
ich hasse Winhttp. Kommt bei mir auf die Todesliste.
#include <WinHTTP.au3>
[/autoit] [autoit][/autoit] [autoit]$username="user"
$password="pass"
$post = "os_username=" & $username&"&os_password="&$password
$hw_open = _WinHttpOpen("Teest")
$hw_connect = _WinHttpConnect($hw_open, "wiki.inserve.local")
$h_openRequest = _WinHttpOpenRequest($hw_connect,"POST", "/dologin.action","HTTP/1.1", "&login=Anmelden&os_destination=%2Fhomepage.action")
_WinHttpSendRequest($h_openRequest, "Content-Type: application/x-www-form-urlencoded"& @CRLF, $post)
_WinHttpReceiveResponse($h_openRequest)
Local $date=""
Do
$date&=_WinHttpReadData($h_openRequest)
Until @error
msgbox(0,"",$date)
[/autoit] [autoit][/autoit] [autoit]_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
https://wiki.inserve.local/dologin.action
POST /dologin.action HTTP/1.1
Host: wiki.inserve.local
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: https://wiki.inserve.local/login.action?logout=true
Cookie: JSESSIONID=4F0C1FDB71AE92BD1570BF82BA4A5245
Content-Type: application/x-www-form-urlencoded
Content-Length: 81
os_username=MEINUSERNAME&os_password=MEINPASSWORT&login=Anmelden&os_destination=
HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Cache-Control: no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Confluence-Request-Time: 1331021740585
Set-Cookie: JSESSIONID=859AEDEAD6CD1F1E46EB73FD001CD9A0; Path=/; Secure; HttpOnly
X-Seraph-LoginReason: OK
Location: https://wiki.inserve.local/
Content-Type: text/html;charset=UTF-8
Content-Length: 0
Date: Tue, 06 Mar 2012 08:15:40 GMT
POST /dologin.action os_username=MEINUSERNAME&os_password=MEINPASSWORT&login=Anmelden&os_destination=%2Fhomepage.action
Probiers mal so
#include <WinHTTP.au3>
[/autoit] [autoit][/autoit] [autoit]$username="user"
$password="pass"
$post = "os_username=" & $username&"&os_password="&$password&"&login=Anmelden&os_destination=%2Fhomepage.action"
$hw_open = _WinHttpOpen("Teest")
$hw_connect = _WinHttpConnect($hw_open, "wiki.inserve.local")
$h_openRequest = _WinHttpOpenRequest($hw_connect,"POST", "/dologin.action","HTTP/1.1")
_WinHttpSendRequest($h_openRequest, "Content-Type: application/x-www-form-urlencoded"& @CRLF, $post)
_WinHttpReceiveResponse($h_openRequest)
Local $date=""
Do
$date&=_WinHttpReadData($h_openRequest)
Until @error
msgbox(0,"",$date)
[/autoit] [autoit][/autoit] [autoit]_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
bekomm leider immer nur den quelltext der login seite.
#include <WinHTTP.au3>
[/autoit] [autoit][/autoit] [autoit]$username="user"
$password="pass"
$post = "os_username=" & $username&"&os_password="&$password&"&login=Anmelden&os_destination=%2Fhomepage.action"
$hw_open = _WinHttpOpen("Teest")
$hw_connect = _WinHttpConnect($hw_open, "wiki.inserve.local")
$h_openRequest = _WinHttpOpenRequest($hw_connect, "GET", "/dologin.action")
_WinHttpSendRequest($h_openRequest)
_WinHttpReceiveResponse($h_openRequest)
_WinHttpCloseHandle($h_openRequest)
$h_openRequest = _WinHttpOpenRequest($hw_connect,"POST", "/dologin.action","HTTP/1.1")
_WinHttpSendRequest($h_openRequest, "Content-Type: application/x-www-form-urlencoded"& @CRLF, $post)
_WinHttpReceiveResponse($h_openRequest)
Local $date=""
Do
$date&=_WinHttpReadData($h_openRequest)
Until @error
msgbox(0,"",$date)
[/autoit] [autoit][/autoit] [autoit]_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
....
no
mir ist grade aufgefallen, das du über https und nicht über http gehst
Probier mal die Funktionen:
[autoit]_WinHttpSimpleSSLRequest
_WinHttpSimpleSendSSLRequest
gute idee !
aber leider das Gleiche
sendsslreq. = quelltext der loginseite
sslreq. = leerer code.
Kev schau mal ob dir die Lösung vom Aufbau des Request --> letzter Beitrag weiter hilft.
Datei via SSL an ein htaccess-geschütztes PHP-Skript senden
[Nachtrag]
Bei mir auf Arbeit habe ich folnende Methode im Einsatz. (reine Anmeldung)
Das müßtest du dann natürlich für deine zwecke noch anpassen.
Versuch es mal mit dem Objekt WinHttp.WinHttpRequest.5.1
#include <Winhttp.au3>
;WinHttp-Objekt erzeugen
$http = ObjCreate("WinHttp.WinHttpRequest.5.1")
;Seite 1 ansteuern
$http.Open("GET", "http://domain.de/unterordner/index.php", false)
;htaccess-Autentifizierung
$http.SetCredentials("username", "passwort", 0)
$http.Send()
;Status und Header anzeigen
ConsoleWrite($http.Status + " --> " + $http.StatusText & @LF)
ConsoleWrite($http.GetAllResponseHeaders & @LF)
ConsoleWrite($http.ResponseText & @LF)
$ergebnis_1 = $http.ResponseText
ConsoleWrite($ergebnis_1 & @LF)
Hi,
probiere das mal aus:
#include <WinHTTP.au3>
[/autoit] [autoit][/autoit] [autoit]$username = _URIEncode("deinName")
$password = _URIEncode("deinPasswort")
$post = "os_username=" & $username&"&os_password="&$password&"&login=Anmelden&os_destination=%2Fhomepage.action"
[/autoit] [autoit][/autoit] [autoit]$hw_open = _WinHttpOpen("Client")
$hw_connect = _WinHttpConnect($hw_open, "wiki.inserve.local",$INTERNET_DEFAULT_HTTPS_PORT)
$h_openRequest = _WinHttpOpenRequest($hw_connect,"POST", "/dologin.action","HTTP/1.1", _
$WINHTTP_NO_REFERER, $WINHTTP_DEFAULT_ACCEPT_TYPES, $WINHTTP_FLAG_SECURE)
_WinHttpSendRequest($h_openRequest, "Content-Type: application/x-www-form-urlencoded" & @CRLF, $post)
_WinHttpReceiveResponse($h_openRequest)
$header = _WinHttpQueryHeaders($h_openRequest)
MsgBox(0, "Header", $header)
If _WinHttpQueryDataAvailable($h_openRequest) Then
Local $data=""
Do
$data&=_WinHttpReadData($h_openRequest)
Until @error<>0
MsgBox(0, "Body", $data)
EndIf
_WinHttpCloseHandle($h_openRequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
Func _URIEncode($sData)
; Prog@ndy
Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"")
Local $nChar
$sData=""
For $i = 1 To $aData[0]
;~ ConsoleWrite($aData[$i] & @CRLF)
$nChar = Asc($aData[$i])
Switch $nChar
Case 45, 46, 48-57, 65 To 90, 95, 97 To 122, 126
$sData &= $aData[$i]
Case 32
$sData &= "+"
Case Else
$sData &= "%" & Hex($nChar,2)
EndSwitch
Next
Return $sData
EndFunc
Func _URIDecode($sData)
; Prog@ndy
Local $aData = StringSplit(StringReplace($sData,"+"," ",0,1),"%")
$sData = ""
For $i = 2 To $aData[0]
$aData[1] &= Chr(Dec(StringLeft($aData[$i],2))) & StringTrimLeft($aData[$i],2)
Next
Return BinaryToString(StringToBinary($aData[1],1),4)
EndFunc
Gruß Greek