화면 » Api

httprequestpostsync

Description

해당 URL을 Post방식으로 호출하기위한 API이다. 비동기방식으로 동작하며 해당 서비스 URL을 호출 후 결과값은 오브젝트 형태로 전달된다.

Parameters

Parameters Type Description
strKey STRING 유일한 키값
strURL STRING 호출할 서비스 URL
bEncodingUTF8 BOOL URL을 UTF8로 Encoding할지 여부
objHttpHeader INSTANCE Http Header에 추가할 헤더정보 오브젝트
strPostData STRING 서비스 호출시 넘겨줄 데이터

Return Value

Type Description
class url 호출에 대한 결과 정보 오브젝트

Remark

async/await 문법을 사용하여 AJAX 통신을 처리를 하는 함수이며, IE 브라우저는 지원하지 않는다.

API 리턴시 통신 처리가 완료된 것을 의미한다.

objHttpHeader 파라미터는 URL호출시 Http 헤더에 추가적으로 담을 데이터가 있다면 일반 자바스크립트 오브젝트의 형태로 전달한다.

** 반환되는 결과값 정보 오브젝트
objHttpResult = {
	strkey: "",	  // 함수 호출시 전달한 strKey 파라미터 값
	nresult: 1,      // 결과값 (1: 정상, 0: 에러)
	strerror: "",    // 결과값이 에러일때 에러메세지
	nerrorcode: 0,   // 결과값이 에러일때 에러코드
	strrecvdata: ""  // 정상적으로 수신받은 경우 수신데이터
}

Example

async function btn_on_mouseup(objInst) { var strKey, objHttpHeader, objHttpResult; // 중복되지 않을 키값생성 strKey = "Test_GetNPost_" + factory.getsystemtime("%Y%M%D%h%m%s%ms"); factory.consoleprint("before httprequestpostsync"); // 거래 수신 완료후 호출될 함수는 GTEST라는 모듈내의 // module_callbackfunc - 공통모듈 함수 호출 objHttpResult = await screen.httprequestpostsync(strKey, "http://192.168.0.208:8080/Test_GetNPost.jsp", false, objHttpHeader, "value=TestPostdata_async", ""); factory.consoleprint("after httprequestpostsync"); factory.consoleprint("key : " + objHttpResult.strkey); factory.consoleprint("result : " + objHttpResult.nresult); factory.consoleprint("error msg : " + objHttpResult.strerror); factory.consoleprint("error code : " + objHttpResult.nerrorcode); factory.consoleprint("recv data : " + objHttpResult.strrecvdata); }

See Also

httprequestpostasync

Viewer Ver.

23.3.28.1

Update Date

20230328