1

我正在 webharvest 中尝试以下代码

 <var-def name="url">https://www.athome.com/on/demandware.store/Sites-athome-Site/default/Stores-FindByZip?</var-def>

<var-def name="urlResult">
 <html-to-xml>
 <http url="${url}" method="GET"  >
     <http-param name="Content-Type">text/html;charset=UTF-8</http-param>   
    <http-param name="dwfrm_storelocator_countryCode">US</http-param>
    <http-param name="dwfrm_storelocator_distanceUnit">mi</http-param>
    <http-param name="dwfrm_storelocator_postalCode">07054</http-param>
    <http-param name="dwfrm_storelocator_maxdistance">999999</http-param>
    <http-param name="dwfrm_storelocator_findbyzip">Search</http-param>
</http> 
</html-to-xml>
</var-def>

我收到错误消息,指出处理您的请求时出错。

错误截图是错误截图

但是当我用所有参数定义 url 时,我得到了预期的结果

 <var-def name="url"><template>https://www.athome.com/on/demandware.store /Sites-athome-Site/default/Stores-FindByZip?dwfrm_storelocator_countryCode=US&amp;dwfrm_storelocator_distanceUnit=mi&amp;dwfrm_storelocator_postalCode=07054&amp;dwfrm_storelocator_maxdistance=999999&amp;dwfrm_storelocator_findbyzip=Search</template></var-def>

<var-def name="urlResult">
     <html-to-xml>
     <http url="${url}" method="GET">
        </http> 
    </html-to-xml>
    </var-def> 

为什么我们会有这种不同的行为?

谢谢 !

4

0 回答 0