Home Pass parameter from Json Httparty to ostruct
Reply: 0

Pass parameter from Json Httparty to ostruct

user416
1#
user416 Published in June 19, 2018, 6:30 pm

I would like to take data from the response is put inside collection

require 'httparty'
require 'ostruct'
require 'nokogiri'

response = HTTParty.get('http://localhost:3000/api/v2/teste')
   #example response   {x:[{"testey":1213,"Testex":"2018-03-07"}]}

collection = [
  OpenStruct.new(
    :testex => '657758',
    :testey => 'CTH6536'
   )
]
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.390265 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO