[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTPAPI http_url_get
No problem John,
If you find you need the entire RPGLE source I can send that over.
Cheers!
On Thu, Oct 27, 2016 at 8:45 AM, John Long
<[1]John.Long@xxxxxxxxxxxxxx> wrote:
Thanks Chris,� Late in the day and I missed the� code, thought it
was the http_url_get_raw code, time to go home or grab a coffee I
think
Thanks for the help
-----Original Message-----
From: [2]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Chris
Edmondson
Sent: 27 October 2016 16:27
To: HTTPAPI and FTPAPI Projects <[4]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: HTTPAPI http_url_get
John,
I don't believe it writes it to the IFS as well, unless you were to
instruct the procedure to do so.
Yes, HTTP_RAW_SAVE is a procedure. It's posted in the body of the email
I sent earlier. You can copy the prototype for it from the procedure
interface shown.
On Thu, Oct 27, 2016 at 8:19 AM, John Long
<[5]John.Long@xxxxxxxxxxxxxx> wrote:
> Hi,
>
> Thanks for the quick reply, If I use that though doesn�it write to
> the ifs too?
>
> Is HTTP_RAW_SAVE a procedure?
>
> John
>
> -----Original Message-----
> From: [6]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[7]ftpapi-bounces@lists.
> [8]scottklement.com] On Behalf Of Chris Edmondson
> Sent: 27 October 2016 15:57
> To: HTTPAPI and FTPAPI Projects <[9]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
> Subject: Re: HTTPAPI http_url_get
>
> Hi John,
>
> You can use http_url_get_raw as shown below:
>
> rc = http_url_get_raw(url: fd: %paddr(HTTP_RAW_SAVE));
> >
> >
> Where the HTTP_RAW_SAVE procedure looks like:
>
>� *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >� *� �This is called by the HTTP_url_get_raw() API each time
> >� *� �data is received from the HTTP server.
> >� *
> >� *� �We use it to show the user how many bytes have been
> >� *� �received, and then we write the received data to disk.
> >� *
> >� *� �Parameters:
> >� *� � � � peFD = number that we passed to HTTP_url_get_raw().
> >� *� � � � � � � �(We use the file descriptor that we got
when
> >� *� � � � � � � � we opened the stream file that we're
saving to)
> >� *� � � peData = pointer to the data that was received from
http
> >� *� � � � � � � � server.
> >� *� � � �peLen = length of data received
> >� *
> >� *� �we return the length we received from HTTPAPI if successful
> >� *� � �or -1 if we can't write the data to disk.
> >� *++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > P http_raw_save� �B
> > D http_raw_save� �PI� � � � � � 10I 0
> > D� �peFD� � � � � � � � � � � � 10I 0 value
> > D� �peData� � � � � � � � � � � � *� �value
> > D� �peLen� � � � � � � � � � � �10I 0 value
> > d
> > d peDta� � � � � �s� � � � � 32000a� �based(peData)
> >
> > D QMHSNDPM� � � � PR� � � � � � � � � ExtPgm('QMHSNDPM')
> > D� �MessageID� � � � � � � � � � 7A� �Const
> > D� �QualMsgF� � � � � � � � � � 20A� �Const
> > D� �MsgData� � � � � � � � � � 256A� �Const
> > D� �MsgDtaLen� � � � � � � � � �10I 0 Const
> > D� �MsgType� � � � � � � � � � �10A� �Const
> > D� �CallStkEnt� � � � � � � � � 10A� �Const
> > D� �CallStkCnt� � � � � � � � � 10I 0 Const
> > D� �MessageKey� � � � � � � � � �4A
> > D� �ErrorCode� � � � � � � � 32766A� �options(*varsize)
> >
> > D dsEC� � � � � � DS
> > D� dsECBytesP� � � � � � �1� � � 4I 0 inz(0)
> > D� dsECBytesA� � � � � � �5� � � 8I 0 inz(0)
> >
> > D wwMsgKey� � � � S� � � � � � � 4A
> > D wwText� � � � � s� � � � � � 100A� �varying
> >
> > c� � � � � � � � � �eval� � � Bytes = Bytes + peLen
> > c� � � � � � � � � �eval� � � wwText =
%trim(%editc(Bytes:'P')) +
> > c� � � � � � � � � � � � � � � � ' bytes received'
> >
> > c� � � � � � � � � �if� � � � peFd <> -1
> > c� � � � � � � � � �if� � � � write(peFd: peData:
peLen) < 1
> > c� � � � � � � � � �return� � -1
> > c� � � � � � � � � �endif
> > c� � � � � � � � � �else
> > c� � � � � � � � � �eval� � � rcvDta = rcvDta +
> > c� � � � � � � � � � � � � � � � � � � %subst(peDta: 1: peLen)
> > c� � � � � � � � � �endif
> >
> > c� � � � � � � � � �return� � peLen
> > P� � � � � � � � �E
>
>
>
> On Thu, Oct 27, 2016 at 7:13 AM, John Long
<[10]John.Long@xxxxxxxxxxxxxx>
> wrote:
>
> >� � Hi All,
> >
> >
> >� � I need to receive a CSV file that is generated when I issue� a HTTP
> >� � GET,� I know I can use http_url_get specifying the URL and
file
> > name
> in
> >� � the IFS,
> >
> >
> >� � Is there a way that I can get the file straight into memory
and
> >� � manipulate it there rather than having it automatically stored
in the
> >� � IFS and then accessing from there?
> >
> >
> >� � Thanks in advance
> >
> >
> >� � John
> >
> >
> >
> >
> >� � _____________________________________________________________
T.J.
> >� � MORRIS LTD-CONFIDENTIALITY NOTICE This e-mail and its
contents,
> >� � together with any attachments, are confidential to the sender
and the
> >� � intended recipient(s). If you are not the intended recipient
or agent
> >� � responsible for delivery to the intended recipient any
unauthorised
> >� � storage, use, disclosure, copying, distribution or
dissemination of
> >� � this e-mail or any part thereof is strictly prohibited and may
be
> >� � illegal. If you receive this e-mail in error please advise us
by
> >� � telephone on [11]+44(0)151 530 2920 and delete and destroy
this
> > e-mail
> and
> >� � any attachments and any copies thereof from your system
immediately.
> >� � Any views or opinions expressed in this e-mail are solely
those of the
> >� � sender and do not necessarily represent those of T J Morris
Ltd.
> >� � Although any attachments to this e-mail have been checked for
viruses
> >� � we make no representation and give no warranty as to the
absence of
> >� � viruses and you should scan this e-mail and attachments for
viruses.
> >� � ___________________________________________________________
> >
> > ------------------------------------------------------------
--------
> > --
> > - This is the FTPAPI mailing list.� To unsubscribe, please go to:
> > [12]http://www.scottklement.com/mailman/listinfo/ftpapi
> > ------------------------------------------------------------
--------
> > --
> > -
> >
> >
>
>
> --
> Chris Edmondson
> [13]509.670.6817
> _____________________________________________________________ T.J.
> MORRIS LTD-CONFIDENTIALITY NOTICE This e-mail and its contents,
> together with any attachments, are confidential to the sender and the
intended recipient(s).
> If you are not the intended recipient or agent responsible for
> delivery to the intended recipient any unauthorised storage, use,
> disclosure, copying, distribution or dissemination of this e-mail or
> any part thereof is strictly prohibited and may be illegal. If you
> receive this e-mail in error please advise us by telephone on
> [14]+44(0)151 530 2920 and delete and destroy this e-mail and any
> attachments and any copies thereof from your system immediately. Any
> views or opinions expressed in this e-mail are solely those of the
> sender and do not necessarily represent those of T J Morris Ltd.
> Although any attachments to this e-mail have been checked for viruses
> we make no representation and give no warranty as to the absence of
viruses and you should scan this e-mail and attachments for viruses.
> ___________________________________________________________
> ------------------------------------------------------------
----------
> - This is the FTPAPI mailing list.� To unsubscribe, please go to:
> [15]http://www.scottklement.com/mailman/listinfo/ftpapi
> ------------------------------------------------------------
----------
> -
>
--
Chris Edmondson
[16]509.670.6817
_____________________________________________________________ T.J.
MORRIS LTD-CONFIDENTIALITY NOTICE This e-mail and its contents,
together with any attachments, are confidential to the sender and the
intended recipient(s). If you are not the intended recipient or agent
responsible for delivery to the intended recipient any unauthorised
storage, use, disclosure, copying, distribution or dissemination of
this e-mail or any part thereof is strictly prohibited and may be
illegal. If you receive this e-mail in error please advise us by
telephone on [17]+44(0)151 530 2920 and delete and destroy this e-mail
and any attachments and any copies thereof from your system
immediately. Any views or opinions expressed in this e-mail are solely
those of the sender and do not necessarily represent those of T J
Morris Ltd. Although any attachments to this e-mail have been checked
for viruses we make no representation and give no warranty as to the
absence of viruses and you should scan this e-mail and attachments for
viruses. ___________________________________________________________
-----------------------------------------------------------------------
This is the FTPAPI mailing list.� To unsubscribe, please go to:
[18]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
Chris Edmondson
509.670.6817
References
1. mailto:John.Long@xxxxxxxxxxxxxx
2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
4. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
5. mailto:John.Long@xxxxxxxxxxxxxx
6. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
7. mailto:ftpapi-bounces@lists
8. http://scottklement.com/
9. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
10. mailto:John.Long@xxxxxxxxxxxxxx
11. tel:%2B44%280%29151%20530%202920
12. http://www.scottklement.com/mailman/listinfo/ftpapi
13. tel:509.670.6817
14. tel:%2B44%280%29151%20530%202920
15. http://www.scottklement.com/mailman/listinfo/ftpapi
16. tel:509.670.6817
17. tel:%2B44%280%29151%20530%202920
18. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------