全部,我正在使用PUT使用REST::Client
进行休息通话。我一直拿到500,我已经尝试了同样的卷曲:成功
curl -v -i -H "application/xml" -X PUT -u username:password "http://wltxnhjxhdms02.xxxx.com:8080/spectrum/restful/model/0x100c4d?attr=0x1295d&val=true"
这是我的REST::Client
代码:
my $username = 'username';
my $password = 'password';
my $headers = {Accept => 'application/xml', Authorization => 'Basic ' . encode_base64($username . ':' . $password)};
my $client = REST::Client->new();
$client->setHost('http://wltxnhjxhdms02.xxxx.com:8080');
$client->PUT('/spectrum/restful/model/'. $_[0] .'?attr=0x1295d&val=false', $headers) || die "$!";
return $client->responseCode();
一位同事用powershell测试了它,没有任何问题