Inserting Data Using RESTful Service
you will create a RESTful Service to insert data using the HTTP Method POST.
You will use the postman tool to test your RESTful Service and to verify the results.
In the empall Template, create a new POST Handler.
BEGININSERT INTO EMP(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)VALUES(:EMPNO,:ENAME,:JOB,:MGR,TO_DATE(:HIREDATE,'DD-MON-RR'),:SAL,:COMM,:DEPTNO);htp.prn('employee '|| :EMPNO);END;
In the postman tool to test the POST request, we have to set the Content-type to application/json.
Click the Headers tab under the URL bar.
Under the heading KEY, enter Content-Type, and for VALUE enter application/json.
In the postman tool to test the POST request, click the Body tab,
check raw, and enter the json code shown below. Click Send
Check the new inserted record informationby using the GET handler created in the previous section, adding 124 to the end of the URL.
http://localhost:8080/ords/re/EMP_TEST/emp/124
ليست هناك تعليقات:
إرسال تعليق