Sponsored Content
Top Forums Shell Programming and Scripting ery weird wget/curl output - what should I do? Post 302554946 by Corona688 on Tuesday 13th of September 2011 12:22:44 PM
Old 09-13-2011
Quote:
Originally Posted by alister
When Firefox requests the file, it indicates that it accepts gzip encoding. When wget or curl ask for it, they do not indicate this. In a bizarre attempt to be helpful, instead of sending you the compressed text file, or redirecting, or refusing to comply, the webserver sends you plain text.
Could this be server-side compression gone wrong? Many webservers support sending text as zipped data, but to do the reverse operation is just weird. It'd make sense for character encodings but not for a file on disk. You don't have to say you accept binary/unknown to download binary/unknown...

---------- Post updated at 10:22 AM ---------- Previous update was at 10:19 AM ----------

--header 'Accept-Encoding: gzip' works for wget too.

Last edited by Corona688; 09-13-2011 at 01:32 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed in Curl & Wget

We are trying to invoke a https service from our unix script using curl command. The service is not getting invoked because it is SSL configured. Bypassing certification (using curl –k) does not work. curl -k https://site curl -k -x IP:Port https://site curl -k -x IP:443 https://id:pwd@site ... (0 Replies)
Discussion started by: dineshbabu01
0 Replies

2. Shell Programming and Scripting

Proxy with curl/wget support

I need a proxy that would enable me to use cli curl/wget with another ip address. How do I find a paid proxy server that supports curl/wget? (1 Reply)
Discussion started by: locoroco
1 Replies

3. Shell Programming and Scripting

Specifying IP address with curl/wget

Hello, I am wondering does anyone know of a method using curl/wget or other where by I could specify the IP address of the server I wish to query for a website. Something similar to editing /etc/hosts but that can be done directly from the command line. I have looked through the man pages... (4 Replies)
Discussion started by: colinireland
4 Replies

4. Shell Programming and Scripting

How to download file without curl and wget

Hi I need a Shell script that will download a zip file every second from a http server but i can't use neither curl nor wget. Can anyone will help me go about this task ??? Thanks!! (1 Reply)
Discussion started by: rubber08
1 Replies

5. Shell Programming and Scripting

Encapsulating output of CURL and/or WGET

i use curl and wget quite often. i set up alarms on their output. for instance, i would run a "wget" on a url and then search for certain strings within the output given by the "wget". the problem is, i cant get the entire output or response of my wget/curl command to show up correctly in... (3 Replies)
Discussion started by: SkySmart
3 Replies

6. Shell Programming and Scripting

Wget vs Curl - Proxy issue

Hi, My script needs to crawl the data from a third party site. Currently it is written in wget. The third party site is of shared interface with different IP addresses. My wget works with all the IP address but not with one. Whereas the curl is able to hit that IP address and comes out... (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

7. Shell Programming and Scripting

Wget/curl credentials validation

Experts, I login to a 3rd party and pull some valuable information with my credentials. I pass my credentials via --post-data in wget. Now my Account is locked. I want my wget to alert that the Account is locked. How can i achieve this. My idea is, get the Source page html from the... (2 Replies)
Discussion started by: sathyaonnuix
2 Replies

8. Shell Programming and Scripting

How to get content of a webpage Curl vs Wget?

Hello, What I am trying to do is to get html data of a website automatically. Firstly I decided to do it manually and via terminal I entered below code: $ wget http://www.***.*** -q -O code.html Unfortunately code.html file was empty. When I enter below code it gave Error 303-304 $... (1 Reply)
Discussion started by: baris35
1 Replies

9. Shell Programming and Scripting

Wget and curl to post data

i'm using this command to post data to a remote host: wget --post-data="My Data" http://<my-ip>:80 -O /dev/null -q and curl --data "My Data" http://<my-ip>:80 however, when i run the above, i see the following in my access log on the remote host: Wget: 10.10.10.10 - - "POST /... (1 Reply)
Discussion started by: SkySmart
1 Replies

10. Web Development

Wget/curl and javascript

What can I use instead of wget/curl when I need to log into websites that use javascript? Wget and curl don't handle javascript. (6 Replies)
Discussion started by: locoroco
6 Replies
Ns_ConnFlush(3aolserver)				   AOLserver Library Procedures 				  Ns_ConnFlush(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnFlush, Ns_ConnFlushDirect - Flush content to an open connection SYNOPSIS
#include "ns.h" int Ns_ConnFlush(conn, buf, len, stream) int Ns_ConnFlushDirect(conn, buf, len, stream) ARGUMENTS
char *buf (in) Pointer to buffer to send. Ns_Conn conn (in) Pointer to current connection. int len (in) Length of bytes pointed to by buf. int stream (in) Boolean value to indicate a streamed response. _________________________________________________________________ DESCRIPTION
These routines support sending content to the client through the connection's communcation driver. They support generating both complete single responses or streaming content through multiple calls. They both take a pointer to the current connection specified by the conn argument and a pointer to content to send specified by buf of length len. If len is negative, buf is assumed to be a null terminated string and len is calculated by strlen. The stream argument, if zero, indicates a single response should be generated. In this case, an appropriate content-length header is gen- erated, the content is sent, and the connection is closed with Ns_ConnClose. If stream is not zero, the call is assumed to be one of potential multiple calls which will send content incrementally to the client. Content streamed in this case is sent either in chunked encoding mode for HTTP/1.1 clients or directly, without a content-length as was common in pre-HTTP/1.1 applications. Applications which stream content should be sure to make a final call Ns_ConnFlush or Ns_ConnFlushDirect with stream set to zero to correctly flush and close the connection. The Ns_ConnFlush and Ns_ConnFlushDirect differ in their treatment of the given content before sending. Ns_ConnFlushDirect does not alter the content in anyway, treating is as an arbitrary array of bytes. Ns_ConnFlush assumes the content is UTF-8 text, e.g., the result of an ADP page execution. In this case, if the connection has an associated output encoding set with the Ns_ConnSetEncoding routine, it will be used to encode the content in the requested character set (e.g., from UTF-8 to iso8859-1). In addition, if the server has gzip compression enabled, the nszlib module is loaded, the connection has been marked for gzip compression with the Ns_ConnSetGzipFlag, and the size of the output data is greater than the server configured minimun gzip compression size, the content will be compressed and an appropriate header will be generated for the client. Gzip compression is not supported when content is streamed to the client. The first call to Ns_ConnFlush or Ns_ConnFlushDirect for a connection, in stream or single response mode, will result in appropriate head- ers being constructed and sent first before any user data. These headers include the basic headers constructed via Ns_ConnSetRequiredHead- ers plus any additional application specific headers queued for output via Ns_ConnSetHeaders or Ns_ConnCondSetHeaders. The Ns_ConnFlush routine may add additional headers as needed to specify chunked and/or gzip encoding. EXAMPLE
The following example generates a simple text response: Ns_ConnSetStatus(conn, 200); Ns_ConnSetType(conn, "text/plain"); Ns_ConnFlush(conn, "Hello", 5, 0); The following example demonstrates streaming: Ns_ConnSetStatus(conn, 200); Ns_ConnSetType(conn, "text/plain"); for (i = 0; i < 10; ++i) { sprintf(buf, "stream: %d0, i); Ns_ConnFlush(conn, buf, -1, 1); } Ns_ConnFlush(conn, "done!", 5, 0); SEE ALSO
Ns_ConnSend(n), Ns_ConnClose(3), Ns_ConnSetRequiredHeaders(3), Ns_ConnQueueHeaders(3) KEYWORDS
connection i/o, gzip, stream, encoding, flush AOLserver 4.5 Ns_ConnFlush(3aolserver)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy