我正在尝试在otrs系统中创建票证,但它仍然返回301:永久移动。我正在使用OTRS 5 Free。
我的要求是:https://some.domain.com/nph-genericinterface.pl/Webservice/GenericTicketREST/Ticket
信息正文:
---
Debugger:
DebugThreshold: debug
TestMode: '0'
Description: Ticket Connector REST Sample
FrameworkVersion: 4.x git
Provider:
Operation:
SessionCreate:
Description: Creates a Session
MappingInbound: {}
MappingOutbound: {}
Type: Session::SessionCreate
TicketCreate:
Description: Creates a Ticket
MappingInbound: {}
MappingOutbound: {}
Type: Ticket::TicketCreate
TicketGet:
Description: Retrieves Ticket data
MappingInbound: {}
MappingOutbound: {}
Type: Ticket::TicketGet
TicketSearch:
Description: Search for Tickets
MappingInbound: {}
MappingOutbound: {}
Type: Ticket::TicketSearch
TicketUpdate:
Description: Updates a Ticket
MappingInbound: {}
MappingOutbound: {}
Type: Ticket::TicketUpdate
Transport:
Config:
KeepAlive: ''
MaxLength: '100000000'
RouteOperationMapping:
SessionCreate:
RequestMethod:
- POST
Route: /Session
TicketCreate:
RequestMethod:
- POST
Route: /Ticket
TicketGet:
RequestMethod:
- GET
Route: /Ticket/:TicketID
TicketSearch:
RequestMethod:
- GET
Route: /Ticket
TicketUpdate:
RequestMethod:
- PATCH
Route: /Ticket/:TicketID
Type: HTTP::REST
RemoteSystem: ''
Requester:
Transport:
Type: ''
这是我的服务配置:
django-allauth==0.23.0
SOCIALACCOUNT_PROVIDERS = {
'google':
{ 'SCOPE': ['profile', 'email'],
'AUTH_PARAMS': { 'access_type': 'online' }
}}
你能帮我解决这个问题吗?
答案 0 :(得分:1)
如果您收到HTTP 301错误,这很可能意味着您没有正确配置您的Web服务器,并且您的服务器会重定向到某个位置。 OTRS通常使用200 OK
或500 Internal server error
进行回复。
检查您的apache日志,看看那里发生了什么。
我可以像curl
一样创建一张票:
curl "http://example.com/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=login&Password=sekret" \
-H "Content-Type: application/json" \
-d @create_ticket.json
其中create_ticket.json
将是这样的:
{
"Ticket" : {
"Queue" : "Raw",
"Priority" : "3 normal",
"CustomerUser" : "max",
"Title" : "REST Create Test",
"State" : "open",
"Type" : "Unclassified"
},
"Article" : {
"ContentType" : "text/plain; charset=utf8",
"Subject" : "Rest Create Test",
"Body" : "This is only a test"
}
}
答案 1 :(得分:1)