#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../config/environment.rb'
require 'rest_client'

# PixAdmin
#endpoint_url = "http://192.168.200.49:5671/pp_destroy_images"
# PP2a
#endpoint_url = "http://94.23.0.166/pp2_destroy_images"
# PP2b
endpoint_url = "http://94.23.220.25/pp2_destroy_images"

begin
  res = RestClient.post( "#{endpoint_url}", {
                                              "login" => "pixpalace", "pwd" => "pi23pa42", "photo" => ["123456789.jpg"]
                                          }.to_json, content_type: :json, accept: :json)
rescue => e
  puts "**** rescue #{e.inspect}"
end
puts " reponse = #{res.body}"