SAP has the function modules HTTP_GET and HTTP_POST to call remote urls. With HTTP_GET one can just had parameters in the URL to send information to the external system. For example, setting the url to
sends x=1 and y=10 as parameters to mypage. The problem with HTTP GET is that there is a limit on the ammount of data that can be sent (technically it is unlimited in the new specification, but there are still servers that impose the old limit).
To send large ammounts of data using HTTP one should use the POST method (ABAP function HTTP_POST). To accomplish the same call with HTTP_POST first the length of the data must be calculated
len("x=1&y=10") = 8
then the function must be called with the following parameters
ABSOLUTE_URI
REQUEST_ENTITY_BODY_LENGTH 8
REQUEST_ENTITY_BODY x=1&y=10
The function group URL_GENERATION has some data quoting functions to help build valid URLs. Also, the introspector tool is helpful to debug the HTTP calls.
阅读(6637) | 评论(0) | 转发(0) |