0

I wrote PHP code that allows me to communicate with a REST API.

My PHP call issues a cURL call to communicate with the API service. However, I am running into a weird issue where the data that is being received by the API is not what is being sent using cURL.

I would like to setup some type of a middle man to ensure that the request that I send to from Apache is the same data that is received by the API.

The information that I am interested to see is

  1. Request/Received Header
  2. Request/Received Body

I am thinking about ruining Wireshark on the Apache server to capture the packets that are going from my Apache to the API and also everything that is being received from the API to Apache.

After installing Wireshark on the Apache server "a Windows 7 machine" I see a lot of data.

How can I tell Wireshark to only capture the data from Apache to the API and from the API to Apache only?

Thank you for your help.

Junior
  • 11,602
  • 27
  • 106
  • 212

2 Answers2

0

There are many tools for API tsting, starting from very easy to use browser plugins and finishing with someting quite complicated as Apache Jmeter. The idea is to make the calls from your testing software to the API and analyse the request and response. if you are on windows you can use something like Fiddler to intercept the packages that are going out from your machine. If you have access to client server I assume there are tools for various OS to intercept the outgoing packages and analyse them, but you would have to google for those.

Auris
  • 1,309
  • 1
  • 9
  • 18
0

to filter HTTP results in Wireshark, just type http in the filter field and click Apply

to have a better look, just start th capture before the HTTP request and stop it juste after

afterward, if you know the IP of the API server, you can filter a step more with :
http && ip.dst == X.X.X.X

mmm
  • 1,070
  • 1
  • 7
  • 15
  • Very good statring point. I am using this filter now `http &&( ip.dst == 10.0.4.44 || ip.dst == 10.0.4.18)` any way I an see them in order? Request/Response? – Junior Aug 28 '15 at 17:28
  • to filter by IP look this : http://stackoverflow.com/questions/4043406/how-to-filter-by-ip-address-in-wireshark – mmm Aug 28 '15 at 17:31
  • I would like to filter by the time of the request being send and the respond that is received based on that request. for every request I would like to see the respond directly below it. I am not sure how to do that. – Junior Aug 28 '15 at 17:37