Rafa_F
February 16, 2017, 10:00pm
1
I need the parameters from the Jason file which is supplied from the
legacy system to use those parameter values in the program module am
building. can you suggest me any code to read out the jason file.
Let me know if you want me to ask them to modify the jason inorder to be
used by me.
The jason file example is attached in the system.
sai_c
February 18, 2017, 10:05pm
2
Pretty awkward way to store JSON as image.
Have you tried to load the file yet?
Try in IRB:
require “json”
data = JSON.parse(path)
sai_c
February 21, 2017, 4:10pm
3
Robert H. wrote in post #1185569:
Pretty awkward way to store JSON as image.
Have you tried to load the file yet?
Try in IRB:
require “json”
data = JSON.parse(path)
Module: JSON (Ruby 2.4.0)
Thanks Robert it json has worked for me, the json is in the form of a
notepad i had to take a snap to upload it onto the forum
sai_c
February 21, 2017, 4:15pm
4
Could you please help me out with the code to hit the URL to get a
response for the JASON file. I use ruby 1.8.7.
require “net/https”
require “uri”
uri = URI.parse(“https://secure.com/ ”)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
response.body
response.status
response[“header-here”] # All headers are lowercase
I get this error for running the above code
in `initialize’: getaddrinfo: The storage control blocks were destroyed.
(SocketError)
Thanks,
Sai