NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Profiling remote API calls


Joined: 31 May 2017
Posts: 57
Reply with quote
Hi,
is there away to profile a remote API call made with Postman or other tools?

I want to debug Magento API that lately slowed down a lot.

Perhaps I can do this by adding a special header to the request I do with Postman?

Tnx
View user's profileFind all posts by blacktekSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Did you try regular profiler?
Yes it's possible to profile a particular API like what we do with SQL drivers, but it's way trickier and would require significant efforts.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 31 May 2017
Posts: 57
Reply with quote
Hi Dmitri,
How can I do with regular profiler? I need to send a Put request with a certain http body and some auth. headers to the remote endpoint. Is it possible to do this with phped and run settings?
View user's profileFind all posts by blacktekSend private message


Joined: 31 May 2017
Posts: 57
Reply with quote
it seems that with "Run parameters" I cannot set neither PUT parameters nor HTTP Headers. Moreover I cannot make a request to a "virtual endpoint" like /en/index.php/rest/all/V1/products/407011.2105 not matched by a physical script
View user's profileFind all posts by blacktekSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Suppose you have page_a accessible with GET and page_b accessible with PUT and page_a has necessary arrangements to call page_b such as url and push button. In this case you just with profiling page_a and proceed to page_b by clicking on that button. Profiler keeps working as long as debug session is enabled. This session is DBGSESSID cookie that debugger always issues if original request has "c=1" flag (similar to d=1 which stands for debugger and p=1 which stands for profiler) http://www.nusphere.com/kb/technicalfaq/faq_dbg_related.htm#2

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 31 May 2017
Posts: 57
Reply with quote
I think I still have the same problem if I create a such page on the destination host. As far as I know there is no way (with a link/form) to make a PUT request and set some special headers. this is doable with curl or other similar libraries.

If I add the DBGSESSID parameter/values to the PUT request sent via curl to the destination host, do I have any hope it could work?
View user's profileFind all posts by blacktekSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
You don't have to alter PUT at all. It would be enough if you supply COOKIE header and/or GET argument in the URL -- in either case with DBGSESSID variable with corresponding debugger request

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Profiling remote API calls
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic