2014-01-14 5 views
1

고객이 웹 양식에서 질문을 제출할 수 있도록 Zendesk API에 레일 앱을 연결하려고합니다. 질문 (로컬 컴퓨터에서 테스트)를 제출 한 후, 내 레일 서버는 다음과 같은 활동을 보여줍니다 :API 응답을 보는 방법 - 레일

tarted POST "/tickets" for 127.0.0.1 at 2014-01-14 09:22:11 -0800 
Processing by TicketsController#create as HTML 
    Parameters: {"utf8"=>"✓", "authenticity_token"=>"blahblah", "email"=>"[email protected]", "subject"=>"asdfasdf", "body"=>"asdfasdfasdf", "commit"=>"Send Your Question"} 
post https://myaccount.zendesk.com/api/v2/tickets 
    Accept: "application/json" 
    Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" 
    User-Agent: "ZendeskAPI API 1.2.2" 
{:ticket=>#<Hashie::Mash comment=#<Hashie::Mash body="asdfasdfasdf"> requester_id=455344333 subject="asdfasdf">} 

문제이며, 티켓은 내 젠 데스크 계정에 게시되지 않습니다. API의 응답이 무엇인지보고 싶습니다. 문제 해결에 도움이 될 수 있습니다. API 응답을 보는 가장 좋은 방법은 무엇입니까?

+0

(부끄러움이없는 셀프 프로모션!) 모든 언어에서 API 호출을 검사 할 수있는 간단하고 무료 도구가 있습니다. https : //www.runscope.com#debugging –

답변

1

답장을받는 곳마다 대화 형 콘솔을 열 수있는 pry 보석을 설치하는 것이 좋습니다.

binding.pry으로 정렬의 "중단 점"을 설정할 수 있으며 응답을 검사 할 수있는 REPL 콘솔 (irb와 다르지 않음)에 서버가 놓이게됩니다.

관련 문제