Replies: 1 comment 1 reply
-
왠만하면 groovy로 스크립트를 작성하시는걸 추천드립니다. Jython에서 신규 클라이언트를 사용하시려면 신규 HttpClient 가이드를 참고 하셔서 관련 모듈을 메뉴얼하게 전부 import 하시고, 조금씩 변화가 있는 API요소들을 직접 컨버팅 해주셔야 되기 때문에 번거로우실 것 같습니다. Jython에서 신규 클라이언트 사용시 파라미터 관련 오류가 있으시면 (i.e. Status 400 ) HttpRequest 코드 참조 하셔서 스팩에 맞게 호출해 주시면 될 것 같습니다. 아래는 간단히 테스트 해본 샘플입니다. (쿠키 & HTTPRequestControl 설정 없음)
from java.util import HashMap
from org.ngrinder.http import HTTPRequest, HTTPRequestControl, HTTPResponse
...
params = HashMap()
params["name"] = "Conor"
...
result = request.PATCH("{INPUT YOUR API URL}", params)
if result.statusCode == 200 :
return
elif result.statusCode in (301, 302) :
grinder.logger.warn("Warning. The response may not be correct. The response code was %d." % result.statusCode)
return
else :
raise |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
안녕하세요.
성능 테스트 진행 중 patch 호출 방법에 대해서 알고 싶어서 문의글 남깁니다.
기존에는 이런 방식으로 호출을 했었는데, patch는 지원하지 않는다는것을 확인했습니다.
그리고 3.5.4 버전 이후부터, 새로운 http 클라이언트로 호출하여 patch가 지원한다는걸 확인했고,
form-data 헤더 추가하여,
PATCH(): self arg can't be coerced to org.ngrinder.http.HTTPRequest, org.ngrinder.http.method.HTTPPatch [calling TestRunner]
net.grinder.scriptengine.jython.JythonScriptExecutionException: : PATCH(): self arg can't be coerced to org.ngrinder.http.HTTPRequest, org.ngrinder.http.method.HTTPPatch
이렇게 호출하고 있는데, 에러가 발생을 하고 있습니다.
방법이 잘못된것 같은데, 혹시 해결방법이 있을까요? 아니면 기존에 httprequest 에서 patch 메소드를 사용할 수 있는 방법이 있는지 궁금합니다.
Beta Was this translation helpful? Give feedback.
All reactions