Sponsored Content
The Lounge What is on Your Mind? Status of UNIX.COM Forum Transformation Post 303024944 by Neo on Saturday 20th of October 2018 08:59:31 AM
Old 10-20-2018
Slightly rearranged.

Image
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unix port status

disregard solved (0 Replies)
Discussion started by: calamine
0 Replies

2. Shell Programming and Scripting

file name transformation

I've got a multitude of text data files that carry exactly the same kind of data. Unfortunately some of them have a different filename format some are: 'category'_'month'-'year'_act.txt an example being: daf_Apr-1961_act.txt and some are: 'category'_ 'year'-'month'_act.txt an... (16 Replies)
Discussion started by: vrms
16 Replies

3. Shell Programming and Scripting

XML to csv transformation

Hi, I want to write a perl script. Which should accept the xml file, one xsl file and the loaction. The perl script should process the xml file using the xsl file and puts the out put in specified location. For example: My.perl is perls cript. my.xml is like this <?xml version="1.0"... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

4. Shell Programming and Scripting

xslt transformation through Unix

Hi .. I have one input XML and I want to convert into another XML using parameter mapping through Database through Unix shell script. But I dont have idea how to do that. And how can I create xsl sheet if mapping is through database tables. Please help me on this. (1 Reply)
Discussion started by: srinu19
1 Replies

5. UNIX for Advanced & Expert Users

Need help in xslt transformation

Hi I have one input xml file <param name="EXTR_COL" valueDesc="AUTHD_RFLL" value="rx.AUTHD_RFLL" /> There is a mapping parameters in Database. if EXTR_COL is present in input XML then it is mapped to fieldlist. so the o/p XML looks like <fieldlist> <datasource... (1 Reply)
Discussion started by: srinu19
1 Replies

6. Programming

Need best forum site for java (as for unix its unix.com)

Hi All, Can anyone help me for knowing the java best side forums. where i will get a quick responce like here , as i am having lot of question. Thanks (1 Reply)
Discussion started by: aish11
1 Replies

7. Shell Programming and Scripting

Data transformation

I do have an input text file of the following format with 1000's of lines input file: 3386(11:11,Ani:0,Bri:1,ch:1,Jwe:0,Jor:0,LP:0,Lo:0,NS:1,al:1,bo:0,boy:0,bru:0,sh:0,cor:1,dum:0,ery:0,mac:0,mic:0)... (3 Replies)
Discussion started by: Kanja
3 Replies

8. What is on Your Mind?

YouTube: Forum Moderation @UNIX.com | The UNIX and Linux Forums

Forum Moderation @UNIX.com | The UNIX and Linux Forums https://youtu.be/WGwgibE4Rq0 Also note: In the video I mentioned removing legacy menu items in the ModCP which are unused. I have already "CSS'ed out" the unused menu items: ... (0 Replies)
Discussion started by: Neo
0 Replies
AnyEvent::HTTPD::Request(3pm)				User Contributed Perl Documentation			     AnyEvent::HTTPD::Request(3pm)

NAME
AnyEvent::HTTPD::Request - A web application request handle for AnyEvent::HTTPD DESCRIPTION
This is the request object as generated by AnyEvent::HTTPD and given in the request callbacks. METHODS
url This method returns the URL of the current request as URI object. respond ([$res]) $res can be: o an array reference Then the array reference has these elements: my ($code, $message, $header_hash, $content) = [200, 'ok', { 'Content-Type' => 'text/html' }, '<h1>Test</h1>' }] You can remove most headers added by default (like "Cache-Control", "Expires", and "Content-Length") by setting them to undef, like so: $req->respond([ 200, 'OK', { 'Content-Type' => 'text/html', 'Cache-Control' => 'max-age=3600', 'Expires' => undef, }, 'This data will be cached for one hour.' ]); o a hash reference If it was a hash reference the hash is first searched for the "redirect" key and if that key does not exist for the "content" key. The value for the "redirect" key should contain the URL that you want to redirect the request to. The value for the "content" key should contain an array reference with the first value being the content type and the second the content. Here is an example: $httpd->reg_cb ( '/image/elmex' => sub { my ($httpd, $req) = @_; open IMG, "$ENV{HOME}/media/images/elmex.png" or $req->respond ( [404, 'not found', { 'Content-Type' => 'text/plain' }, 'not found'] ); $req->respond ({ content => ['image/png', do { local $/; <IMG> }] }); } ); How to send large files: For longer responses you can give a callback instead of a string to the response function for the value of the $content. $req->respond ({ content => ['video/x-ms-asf', sub { my ($data_cb) = @_; # start some async retrieve operation, for example use # IO::AIO (with AnyEvent::AIO). Or retrieve chunks of data # to send somehow else. } }); The given callback will receive as first argument either another callback ($data_cb in the above example) or an undefined value, which means that there is no more data required and the transfer has been completed (either by you sending no more data, or by a disconnect of the client). The callback given to "respond" will be called whenever the send queue of the HTTP connection becomes empty (meaning that the data is written out to the kernel). If it is called you have to start delivering the next chunk of data. That doesn't have to be immediately, before the callback returns. This means that you can initiate for instance an IO::AIO request (see also AnyEvent::AIO) and send the data later. That is what the $data_cb callback is for. You have to call it once you got the next chunk of data. Once you sent a chunk of data via $data_cb you can just wait until your callback is called again to deliver the next chunk. If you are done transferring all data call the $data_cb with an empty string or with no argument at all. Please consult the example script "large_response_example" from the "samples/" directory of the AnyEvent::HTTPD distribution for an example of how to use this mechanism. NOTE: You should supply a 'Content-Length' header if you are going to send a larger file. If you don't do that the client will have no chance to know if the transfer was complete. To supply additional header fields the hash argument format will not work. You should use the array argument format for this case. responded Returns true if this request already has been responded to. parm ($key) Returns the first value of the form parameter $key or undef. params Returns list of parameter names. vars Returns a hash of form parameters. The value is either the value of the parameter, and in case there are multiple values present it will contain an array reference of values. method This method returns the method of the current request. content Returns the request content or undef if only parameters for a form were transmitted. headers This method will return a hash reference containing the HTTP headers for this HTTP request. client_host This method returns the host/IP of the HTTP client this request was received from. client_port This method returns the TCP port number of the HTTP client this request was received from. COPYRIGHT &; LICENSE Copyright 2008-2011 Robin Redeker, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-08-04 AnyEvent::HTTPD::Request(3pm)
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy