jquery/ajax を使用して残りのサーバーを呼び出そうとしています。残りのサーバーは Codeigniter で構築されています。ajax 関数は次のとおりです。
var req = $.ajax({
type: 'GET',
url: "http://localhost/projects/comp6300Server/index.php/resources/token//username/" + email + "/password/" + pword + "/institution/" + inst,
contentType: "application/json; charset=utf-8",
dataType: "json"
})
生成されるリクエストは次のとおりです。
http://localhost/projects/comp6300Server/index.php/resources/token//username/etambie@yahoo.com/password/qwerty/institution/BCC
返されたステータスは「400 Bad Request」です。「etambie@yahoo.com」で渡された電子メールに問題がある可能性があります。ajax が '@' を '%40' に自動的に変換する方法はありますか? または、文字列内のすべての特殊文字を手動で変換する必要がありますか?