Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > PHPRunner's REST API

REST API troubleshooting

Scroll Prev Next More

 

Most people use software like Postman to test their REST APIs. Postman is user-friendly and does the job well.
 
However, in some situations, Postman doesn't provide enough info to locate the issue and in this case we recommend using a command line utility CURL.  

 

A common mistake - some people use redirect to another page in AfterSuccessfulLogin event, forgetting that it will break REST API flow. In this case Postman will simply return "File not found" error. Running CURL in the command line add -v parameter that will provide a detailed output.
 

 

curl "https://website.com/project/api/v1.php?table=table&action=list" -H "X-Auth-Token: d87gdsjhgdsjgy7643" -v

 

 

And to avoid this kind of issue, use isInRestApi() function that will tell you if we execute our code the "normal" way or are in the middle of REST API call. You should only perform this kind of redirect in case of a regular execution.

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software