Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> utl_http and status 100 continue
This is my environment:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for Solaris: Version 9.2.0.1.0 - Production NLSRTL Version 9.2.0.1.0 - Production
I'm using utl_http to make an https connection to automate a b2b
connection to a bank system.
I know the https part is functional because I can see the first page
(dumping it out from the response via dbms_output).
The second page requires sending some information via a post.
Here's my code that's POSTing the second page.
PROCEDURE pageTwo
IS
v_url VARCHAR2(32767) :=
'https://starprod.swbanktx.com/netstarach/user/logon/logon.asp';
v_args VARCHAR2(32767) :=
'user_id=XXXXXXX&password=XXXXXX&BTNLOGON=Logon';
v_resp utl_http.resp ;
BEGIN
dbms_output.put_line('---start page 2---'); req := Utl_Http.begin_request (url => v_url , method => 'POST'); dbms_output.put_line('---setting headers---'); Utl_Http.set_header (req, 'User-Agent', 'Mozilla/4.0'); dbms_output.put_line('do I get here?') ; utl_http.set_header( req , 'content-length' , length( v_args ) ) ; dbms_output.put_line('do I get here 2?') ;END ; I see all the 'do I get to...' messages. The showstatus function shows the resp.status code as 100 and the reason_phrase as contine.
-- I know this page returns a redirect, but
-- presence or absence of this line makes no difference
utl_http.set_follow_redirect( req , 5 ) ; dbms_output.put_line('do I get here 3?') ;
-- presence or absence of this line make no difference
utl_http.set_header(req, 'Content-type','application/x-www-form-urlencoded'); dbms_output.put_line('do I get here 4?') ; utl_http.write_text( req , v_args ) ; dbms_output.put_line('do I get here 5?') ; v_resp := Utl_Http.get_response (req); dbms_output.put_line('---status---'); showstatus( v_resp ) ; dbms_output.put_line('---headers---'); showheader( v_resp ) ; dbms_output.put_line('---html---'); showBody( v_resp ) ; dbms_output.put_line('---cookies---'); showCookies ; dbms_output.put_line('---complete---');
I can run this set of urls plus two more in curl (a command line http
tool) and I can make posts to my Oracle application server via
essentially the same code.
I've tried adding a CR/LF to the end of my text.
I've tried looking up utl_http and post in google, google groups and
metalink with no joy.
Any comments, suggestions or the like would be appreciated. Received on Wed Aug 06 2003 - 16:29:27 CDT
![]() |
![]() |