자체 호스팅 웹 API (Web API 2.2 + Owin)를 만들었습니다. 이 서비스는 매우 간단하며 GPIO 핀 값 목록 만 반환합니다.내 Respbarry Pi에 자체 호스팅 된 Wep API가 HTTP 400 잘못된 요청으로 연결됨
내 파이 자체에서는 완벽하게 작동합니다. 문제없이 서비스를 호출 할 수 있습니다. 내 PC에서 호출하려고 만 할 때 HTTP 400가 반환됩니다
이가 요청 :
GET http://192.168.178.105/RobotApi/GetGpioPinValues HTTP/1.1
Host: 192.168.178.105
Connection: keep-alive
Accept: application/json, text/plain, */*
Origin: http://localhost
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
Referer: http://localhost/piRobot.WebSite/index.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,de-DE;q=0.6,de;q=0.4
응답 : 거기
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=utf-8
Server: Mono-HTTPAPI/1.0
Date: Fri, 02 Jan 2015 16:19:24 GMT
Content-Length: 35
Connection: close
<h1>Bad Request (Invalid host)</h1>
나는 희망을 누군가가 나를 도울 수 있습니다. 어떤 제안?
고마워, 단테
'invalid host'는 주로 호스트와 포트를 owin으로 설정하는 방법 때문입니다. owin 구성 코드를 공유 할 수 있습니까? – harishr