在不创建代理的情况下使用restful方法的可能方法有哪些? [英] What are the possible ways to use restful methods without creating proxy ?

查看:114
本文介绍了在不创建代理的情况下使用restful方法的可能方法有哪些?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在不使用代理的情况下测试restful方法吗?有什么可能吗?



我尝试过:



目前我用我的方法代理消耗数据,除了那个想法吗?

解决方案

你不需要使用代理方法,你可以直接测试API。 API有几个测试,检查API是否能负担负载的测试,检查所遵循的HTTP标准的测试等等。



在进入性能测试之前,如果您需要向REST API发送请求并进行测试,请考虑使用API​​调试工具,例如< a href =https://www.getpostman.com/>邮递员 [ ^ 。 Postman将使您能够输入API的URL,传递数据或状态,然后进行通信。 Postman的最新版本甚至允许您为API编写自动化任务,我还没有尝试或测试过。



这取决于你,你想做什么。但是,在云计算的现代时代,我们还可以期待您将使用在线API(,因为您没有提到要测试的API )。在这种情况下,



如果您拥有API :那么您可以使用任何运行时测试库或工具并运行测试检查它的表现。调试是一个单独的事情,你也可以在内部进行调试。我说的是测试,比如负载测试等。有几种工具可供选择。



例如,

GitHub - alexfernandez / loadtest :对选定的URL运行负载测试。为了您自己的目的,最容易扩展。 [ ^ ]

Apache JMeter - Apache JMeter™ [ ^ ]



然后,您可以测试这些API的API。这取决于您的语言/运行时选择。



如果您不拥有API :那么您可能只需要测试您的自己的应用程序,并验证它是否符合您的业务逻辑所需。例如,在Azure API上,您需要使用自己的密钥来测试其服务的API。



在这种情况下,您需要查看文档,以及文档建议的内容。 : - )

I need to test restful methods with out using proxies? is there any possibilities ?

What I have tried:

Currently I used proxy to my methods to consume data, other than that any idea ?

解决方案

You do not require to use proxy methods, you can directly test the APIs. There are several tests for the APIs, tests to check whether the API can afford the load, tests to check the standards of the HTTP being followed, and much more.

Before I dive into the performance testing, if you need to send a request to the REST API and just test it, consider using an API debugging tool, such as Postman[^]. Postman will enable you to enter the URLs of the APIs, pass the data or the states, and then communicate. Latest versions of Postman even let you write automation tasks for the APIs, which I yet have not tried or tested.

It is up to you, what you want to do. But however, in the modern time of cloud computing, we can also expect that you will be consuming an online API (since you do not make a mention of what API you want to test). In which case,

If you own the API: Then you can use any of the runtime testing library or tool and run the tests to check how it performs. Debugging is a separate thing, you can do the debugging internally as well. I am talking about tests, like load testing etc. There are several of tools for that.

For example,
GitHub - alexfernandez/loadtest: Runs a load test on the selected URL. Easy to extend minimally for your own ends.[^]
Apache JMeter - Apache JMeter™[^]

You can then test the APIs for these things. It depends on your language/runtime selection.

If you do not own the API: Then chances are that you only need to test your own application, and verify that it does what your business logic requires from it. For example on Azure APIs, you need to use your own keys in order to test the APIs of their services.

In this case, you need to check with the documentation, as to what does the documentation suggests. :-)


这篇关于在不创建代理的情况下使用restful方法的可能方法有哪些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆