utl_http.begin_request [message #492995] |
Fri, 04 February 2011 03:41  |
lokeshsurana
Messages: 212 Registered: April 2010 Location: India
|
Senior Member |
|
|
hi
I am trying to send sms by using www.clickatell.com
i am passing URL to 'ult_HTTP.begin_request'
as URL contain 2 time HTTP and some of special characters it not correctly execute
the code is as follow:
DECLARE
req utl_http.req;
resp utl_http.resp;
value VARCHAR2(1024);
v_url varchar2(1000);
BEGIN
--utl_http.set_proxy('proxy.my-company.com', 'corp.my-company.com');
v_url:='http://api.clickatell.com/http/sendmsg''&''api_id=xxx''&''user=xxx''@''xxx.com''&''password=LokeshKumar''&''to=xxxxxxxxxx''&''text=message';
req := utl_http.begin_request
(url => v_url,
method => 'POST');
utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0');
resp := utl_http.get_response(req);
LOOP
utl_http.read_line(resp, value, TRUE);
dbms_output.put_line(value);
END LOOP;
utl_http.end_response(resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
END;
the output as:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /'&'http/sendmsg'&'api_id=xxxx'&'user=xxxx'@'xxxx.com'&'password=xxxx'&'to=xxxxx'&'text=message was not found on this server.</p>
<hr>
<address>Apache/2.0.52 (Red Hat) Server at api.clickatell.com Port 80</address>
</body></html>
how to pass url to begin_request which contain http 2 times and special characters........????????
please helppppppppp
|
|
|
|