2015-01-20 5 views
0

XML 파일 (test1.xml)을 게시하고 웹 서비스 API에서 출력을 수신하려고합니다. HTTP/1.1 400 잘못된 요청 오류가 발생합니다. 이것은 아래 코드입니다.HTTP 400 잘못된 요청 오류

myheader=c(Connection="close", 
     'Content-Type' = "application/xml", 
     'Content-length' =nchar("test1.xml")) 

data = getURL("http://abcd/efg/requests/", 
      userpwd="m12345:123456", httpauth = 1L, 
      postfields="test1.xml", 
      httpheader=myheader, 
      verbose=TRUE) 

이 확실하지

* Hostname was NOT found in DNS cache 
* Trying 123.456.789.123... 
* Connected to rcftomdev1 (123.456.789.123) port 8086 (#0) 
* Server auth using Basic with user 'm12345' 
> POST /dart/requests/ HTTP/1.1 
Authorization: Basic bTEzNDQ4M#$#$#$#$%5== 
Host: abcd:8086 
Accept: */* 
Connection: close 
Content-Type: application/xml 
Content-length: 9 

* upload completely sent off: 9 out of 9 bytes 
< HTTP/1.1 400 Bad Request 
< Server: Apache-Coyote/1.1 
< Content-Type: text/html;charset=utf-8 
< Content-Length: 968 
< Date: Tue, 20 Jan 2015 07:50:05 GMT 
< Connection: close 
< 
* Closing connection 0 

내가 잘못 가고, 도움이 필요

출력은?

답변

0

실제로 정확히 주어진 사용자 + 암호의 Authorization : 헤더에서 보낸 내용이 있다면 콤보가 bTEyMzQ1OjEyMzQ1Ngo=을 생성 했으므로 심각한 오류가 발생했습니다.

요청의 다른 측면은 문제가 없으므로이 서버 및 API에 대한 서버 측 요구 사항 만 읽으면 답변을 얻을 수 있습니다.