After posting some data using httparty, how can I access the posted values in controller?

StackOverflow https://stackoverflow.com/questions/10467956

  •  06-06-2021
  •  | 
  •  

문제

I have done a posting using httparty.

E.g.

options={ 
  :foo => '123'
  :bar => 'second',
  :baz => 'last thing'
}

HTTParty.post("localhost/tests" , options)

How can I retrieve options parameters in my remote app controller: E.g.

#post /tests
def create
@k=options[:name]  -------> Here is my question, How can I access options[:name]?

I mean should I pass options as an argument of create method? Something like:

def create(options)
@k=options[:name]
도움이 되었습니까?

해결책

Okay it worked for me finally. I should have retrieved each fields separately rather than as a whole. So happy! So now I have 2 rails app. just by wrapping fields separately and fetching them separately I was able to post and retrieve.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top