私はNodeJSで記述されたAzure関数を使用して、302のHTTPリダイレクトを試みています。レスポンス。その結果、私はリダイレクトを生成するための正しいエントリーであるべきと感じるものを作成しましたが、私が得るのはXMLレスポンスだけです。実際のステータスコードを変更するのではなく、ステータスコードのような項目もXMLに表示されます。Azure関数:NodeJS - HTTPレスポンスではなくXMLとしてのHTTPレスポンス
私は間違っていますか?
マイコード:
module.exports = function(context, req){
var url = "https://www.google.com";
context.res = {
status: 302,
headers: {
Location: url
}
}
context.done();
}
これは、私は、ブラウザで取得していレスポンスです:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1164
Content-Type: application/xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 18 Jan 2017 00:54:20 GMT
Connection: close
<ArrayOfKeyValueOfstringanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><KeyValueOfstringanyType><Key>status</Key><Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:int">302</Value></KeyValueOfstringanyType><KeyValueOfstringanyType><Key>headers</Key><Value i:type="ArrayOfKeyValueOfstringanyType"><KeyValueOfstringanyType><Key>Location</Key><Value xmlns:d5p1="http://www.w3.org/2001/XMLSchema" i:type="d5p1:string">https://www.google.com</Value></KeyValueOfstringanyType></Value></KeyValueOfstringanyType></ArrayOfKeyValueOfstringanyType>
null bodyエラーは表示されません。あなたがまだそれを打つなら、あなたはエラーメッセージを投稿できますか?ここで見つける –
完全レポコード: https://github.com/securityvoid/azure-bug/tree/master/app-function-test だけでなく、これを参照してください。 https://github.com/Azure/azure -webjobs-sdk-script/issues/1208#issuecomment-282164915 – Doug