# Reading an API Server Response

**URL:** <https://www.ruby-forum.com/t/reading-an-api-server-response/188409>\
**Category:** Rails\
**Created:** [May 11, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/reading-an-api-server-response/188409 "2010-05-11T16:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindtonic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mindtonic](https://www.ruby-forum.com/u/mindtonic)\
**Post date:** [May 11, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/reading-an-api-server-response/188409/1 "2010-05-11T16:01:49Z")

</div>

Hello,

I am trying to debug an API. Towards the end of the process, the  
remote server sends me a request. I respond to that request with:  
render :text =\> my\_response, :status =\> 200. I am trying to find out  
how to read the remote server’s response.

So basically this is a three part cycle. How do I access the third  
part?

1. Remote Server sends a request
2. I respond with text and a status of 200
3. Remote Server responds with the results of the transaction.

How do I access this third response? I specifically would like to log  
the body of the response so that I can read it and figure out what is  
going on through the api calls.

Any help or direction would be greatly appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![mindtonic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mindtonic](https://www.ruby-forum.com/u/mindtonic)\
**Post date:** [May 11, 2010, 5:11pm UTC](https://www.ruby-forum.com/t/reading-an-api-server-response/188409/2 "2010-05-11T17:11:29Z")

</div>

On Tue, May 11, 2010 at 7:00 AM, Mindtonic [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1. Remote Server responds with the results of the transaction.  
> There’s no such thing as a response to a response. #3 would be a  
> second request, assuming that the remote server is programmed to  
> initiate one. And in that case, presumably you’ll know what URL it’s  
> requesting, right?

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
