我在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>
我收到错误说明处理您的请求时出错。
错误的屏幕截图是Error Screenshot
但是当我用所有参数定义url时,我得到了预期的结果
<var-def name="url"><template>https://www.athome.com/on/demandware.store /Sites-athome-Site/default/Stores-FindByZip?dwfrm_storelocator_countryCode=US&dwfrm_storelocator_distanceUnit=mi&dwfrm_storelocator_postalCode=07054&dwfrm_storelocator_maxdistance=999999&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>
为什么我们会有这种不同的行为?
谢谢!