我是新來的。這是因爲這一個同樣的問題,但我沒有得到回答,所以我再重新發布:how to create a ticket in rt using python-rtkit使用具有RESOURCE_STATUS的python-rtkit創建RT票證:401需要憑證
我都嘗試CookieAuthenticator
和BasicAuthenticator
來創建或讀取票,但我仍然得到了同樣的錯誤:
`RT/3.8.13 401 Credentials required`
當我直接在瀏覽器中加載url時:http://ticket.corp.kk.net/REST/1.0/ticket/214560?user=user&pass=pass,我會在瀏覽器中獲取票據內容。
我甚至試過wget
命令來獲得一頁的內容如下使用cookie,並且它工作得很好:
手動保存在
coookie.txt
文件中的cookie值:RT_SID_kk.net.80=5a1c1eb207c4e2ef5af726e98d751a08
運行此命令:
wget -O ticketContent.txt --keep-session-cookies --save-cookies cookies.txt 'http://ticket.corp.kk.net/REST/1.0/ticket/220680/show?format=l&user=user&pass=pass'
門票內容已在ticketContent.txt
中很好地註冊,這表明使用cookie進行身份驗證正在工作。
但我仍然不能在我的python腳本中通過rtkit的CookieAuthentication
。
我一直在這個問題上掙扎了兩天,如果有人能幫助我,我會深表謝意。謝謝。
可能重複[如何使用python-rtkit在rt中創建票證](http://stackoverflow.com/questions/17890098/how-to-create-a-ticket-in-rt-using -python-rtkit) – ElGavilan 2014-11-07 15:01:44