如何在HTTPService中使用带有特殊字符的请求参数 - Flex

发布于 2024-09-19 01:51:49 字数 895 浏览 7 评论 0原文

目前我有:

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <email>{loginUser}</email> 
            <password>{loginPassword}</password>
        </mx:request>
    </mx:HTTPService>

而不是这个,我有像 userCredentials.email 和 userCredentials.password 这样的参数。 我尝试过这个,但它不起作用。

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <userCredentials.email>{loginUser}</userCredentials.email> 
            <userCredentials.password>{loginPassword}</userCredentials.password>
        </mx:request>
    </mx:HTTPService>

Currently I have :

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <email>{loginUser}</email> 
            <password>{loginPassword}</password>
        </mx:request>
    </mx:HTTPService>

instead of this I have params like userCredentials.email and userCredentials.password.
I tried this but it odesnt work.

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <userCredentials.email>{loginUser}</userCredentials.email> 
            <userCredentials.password>{loginPassword}</userCredentials.password>
        </mx:request>
    </mx:HTTPService>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月隐月明月朦胧 2024-09-26 01:51:49

让我们知道它是否适合您:

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <userCredentials>
                 <email>{loginUser}</email> 
                 <password>{loginPassword}</password>
            </userCredentials>
        </mx:request>
    </mx:HTTPService>

您是否也从 http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_5.html

<?xml version="1.0"?>
<!-- fds\rpc\WebServiceSOAPRequest.mxml --> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="10">
    <mx:WebService id="ws" wsdl="http://api.google.com/GoogleSearch.wsdl"
        useProxy="true">
        <mx:operation name="doGoogleSearch" resultFormat="xml">
            <mx:request format="xml">
                <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                    <key xsi:type="xsd:string">XYZ123</key>
                    <q xsi:type="xsd:string">Balloons</q>
                    <start xsi:type="xsd:int">0</start>
                    <maxResults xsi:type="xsd:int">10</maxResults>
                    <filter xsi:type="xsd:boolean">true</filter>
                    <restrict xsi:type="xsd:string"/>
                    <safeSearch xsi:type="xsd:boolean">false</safeSearch>
                    <lr xsi:type="xsd:string" />
                    <ie xsi:type="xsd:string">latin1</ie>
                    <oe xsi:type="xsd:string">latin1</oe>
                </ns1:doGoogleSearch>
            </mx:request>
        </mx:operation>
    </mx:WebService>
</mx:Application>

我的意思是这个 mx:request 结构?

let us know if its work for you:

<mx:HTTPService id="userLogin" url="https://api.localhost/api/user/login/" method="POST" resultFormat="e4x" result="doSomeThing(event)">
        <mx:request>
            <userCredentials>
                 <email>{loginUser}</email> 
                 <password>{loginPassword}</password>
            </userCredentials>
        </mx:request>
    </mx:HTTPService>

also did you see this from http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_5.html :

<?xml version="1.0"?>
<!-- fds\rpc\WebServiceSOAPRequest.mxml --> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="10">
    <mx:WebService id="ws" wsdl="http://api.google.com/GoogleSearch.wsdl"
        useProxy="true">
        <mx:operation name="doGoogleSearch" resultFormat="xml">
            <mx:request format="xml">
                <ns1:doGoogleSearch xmlns:ns1="urn:GoogleSearch" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                    <key xsi:type="xsd:string">XYZ123</key>
                    <q xsi:type="xsd:string">Balloons</q>
                    <start xsi:type="xsd:int">0</start>
                    <maxResults xsi:type="xsd:int">10</maxResults>
                    <filter xsi:type="xsd:boolean">true</filter>
                    <restrict xsi:type="xsd:string"/>
                    <safeSearch xsi:type="xsd:boolean">false</safeSearch>
                    <lr xsi:type="xsd:string" />
                    <ie xsi:type="xsd:string">latin1</ie>
                    <oe xsi:type="xsd:string">latin1</oe>
                </ns1:doGoogleSearch>
            </mx:request>
        </mx:operation>
    </mx:WebService>
</mx:Application>

i mean this mx:request structure?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文