如何使用此请求在Web服务中传递参数:
post/webservice/user.asmx http/1.1发布 内容类型:text/xml;charset=utf-8 内容长度:长度 soapaction:“http://sample.com/updateuserbatch”
<UpdateUserBatch xmlns="http://sample.com/"> <auth> <Username>string</Username> <Password>string</Password> </auth> <request> <CreateIfNotExist>boolean</CreateIfNotExist> <UpdateIfExists>boolean</UpdateIfExists> <Users> <UserProfile> <UserID>string</UserID> <BusinessID>string</BusinessID> <ExternalID>string</ExternalID> <Username>string</Username> <Password>string</Password> <UpdateDate>dateTime</UpdateDate> </UserProfile> <UserProfile> <UserID>string</UserID> <BusinessID>string</BusinessID> <ExternalID>string</ExternalID> <Username>string</Username> <Password>string</Password> <UpdateDate>dateTime</UpdateDate> </UserProfile> </Users> </request> </UpdateUserBatch>
我想使用那个web服务导入数据。
我不确定 POST 请求,但是 GET 请求通常对多维数组使用方括号表示法。例如:
POST
GET
http://api.example.com/object/?foo[]=bar&foo[]=baz
这将在api端进行组装,如下所示:
'foo' => array( 0 => 'bar', 1 => 'baz' );
当然,可以使用索引数组和数值数组。