如何从angularjs $ HTTP发送点字符作为参数 [英] How to send dot character as a parameter from angularjs $http
问题描述
我试图发送。
(点)作为字符串中的的NodeJS以下ASPI调用。
我使用Angularjs $ HTTP
对象。
I am trying to send .
(dot) as a string to the following aspi call in Nodejs.
I am using Angularjs $http
object.
我可以看到呼叫正在与我在搜索框中输入点(。)字符的。
I can see that the call is being made with the dot (.) character that I have entered in the search box.
然而,当我看到通过谷歌的开发工具Ajax调用,它是拨打电话为:
However, when I see the ajax call through google developer tool, it is making a call as:
我如何传递一个点字符?
How can I pass a dot character?
code是:
收益
$http.get('https://localhost:3003/posts/search/.').then(getPostCompleted).catch(function (message) {
handleException(message);
});
我不认为我有BTOA或本ATOB?
I don't think I have to btoa or atob on this?
谢谢
上午
推荐答案
请参阅的这个中有关使用一个点。
See this about using a dot.
如果你想使用GET,那么你可以传递参数作为查询字符串即
If you want to use GET then you could pass the parameter as a query string i.e
$http.get('https://localhost:3003/posts/search?string=.')
.then(getPostCompleted).catch(function (message) {
handleException(message);
});
否则,你可以使用POST和参数添加到身体
Otherwise you can use POST and add the parameter to the body
$http.post('https://localhost:3003/posts/search', {string: '.'})
.then(getPostCompleted).catch(function (message) {
handleException(message);
});
这篇关于如何从angularjs $ HTTP发送点字符作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!