Hi - I’m sending an SCI request via a Perl Script to a pc gateway to set an xbee pin. It works perfectly but I get an “500 Internal Server Error” returned. Web host says it’s nothing on their end.- it must be script. I’ve tried ruby and python too and I get the same result. Works but error returned. Anyone know what I need to do in the script to handle this? The script is being called from html file. ty
use LWP::UserAgent;
$user_agent = LWP::UserAgent->new;
Sets The Request up for Basic Authentication.
Replace YourUsername and YourPassword with your username and password respectively.
$user_agent->credentials(
‘login.etherios.com:80’,
‘Device Cloud WS’,
‘YourUsername’,‘YourPassword’);
XML Data to be sent in the Request Body.
$request = ’
';
Performs a post to Device Cloud and captures response.
$response= $user_agent->post(“http://login.etherios.com/ws/sci”,
‘Content-Type’ => ‘text/xml’,
‘Content’ => $request);
Prints the Response Content.
print $response->decoded_content;
If Device Cloud determines that the request wasn’t successfully processed, die with the error message.
unless($response->is_success){
die $response->status_line;
}