Sponsored Content
Full Discussion: http HEAD reuest
Top Forums Programming http HEAD reuest Post 302138801 by porter on Wednesday 3rd of October 2007 01:15:23 PM
Old 10-03-2007
1. I thought that line terminators with HTTP were CR/LF pairs not LF

2. and there was supposed to be a blank link following the request header.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help.. I am in way over my head !!!!

my boss has done it again I have been sent to fix a unix issue and I ma hoping you can help three issues 1st. I have a printer that when you try to print to it the print job comes out on a diffrent printer. If I take the printer ( dot matrix thourgh a serail connection) to a diffrent local the... (3 Replies)
Discussion started by: oberon42
3 Replies

2. Shell Programming and Scripting

head command

Hi All, How can the head command be used to extract only a particular line. By default head -n filename displays the first n lines. I want only the nth line. I couldn't get it from forum search. Thanks, Sumesh (6 Replies)
Discussion started by: sumesh.abraham
6 Replies

3. Shell Programming and Scripting

head usage

$ct=1 head -n $ct file. When i used like this, i got an error , Bad usage of head Cant we use variables in place of number in HEAD. In my requirement for every iteration i should increase the number in Head and tail the last one. HOw can i achieve this (5 Replies)
Discussion started by: vasuarjula
5 Replies

4. UNIX for Dummies Questions & Answers

How to send a Head Http request from command line

Ok. I'm testing a new program component that is supposed to speed up our pipeline on the server. What it does is take in HEAD requests and shuffle them off to a different pipeline that is specially designed to handle HEAD requests quickly. The functionality works but now comes the question: how... (3 Replies)
Discussion started by: darkling235
3 Replies

5. Shell Programming and Scripting

head followed by variable??

I know that the common use of head is for example head -3 etc.Is there any possibility that,if i have a variable that equals to an integer(i=5),i can write head -i?? If not,what syntax or commands should i write down in order to have the same result? //maybe something lik head -"$variable" ? (2 Replies)
Discussion started by: bashuser2
2 Replies

6. UNIX for Dummies Questions & Answers

find and head -1

i have lots of files in /law/prod and /law/dev, such as AP20PD, AP20WS, AP20.scr, AP20.rpt if i am in /law DIR find . -name AP20PD, found in /law/prod and /law/dev i want to head -1 AP20PD from both location and >> /tmp/test.log can i use find and head in one line ? ----------... (1 Reply)
Discussion started by: tjmannonline
1 Replies

7. Programming

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (0 Replies)
Discussion started by: senkerth
0 Replies

8. Shell Programming and Scripting

sending http url through http socket programming..

hi am senthil am developing a software to send and receive SMS using HTTP connection first of all am forming a URL and sending that URL to a remote server using my Client Program i send that url through Socket(using Send() Function) if i send more than one URL one by one using the same... (4 Replies)
Discussion started by: senkerth
4 Replies

9. Web Development

HTTP Headers Reference: HTTP Status-Codes

Hypertext Transfer Protocol -- HTTP/1.1 for Reference - HTTP Headers 10 Status Code Definitions Each Status-Code is described below, including a description of which method(s) it can follow and any metainformation required in the response. (1 Reply)
Discussion started by: Neo
1 Replies

10. Shell Programming and Scripting

awk script to find time difference between HTTP PUT and HTTP DELETE requests in access.log

Hi, I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log. Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
Discussion started by: Juha
3 Replies
SOCKET_RECV(3)								 1							    SOCKET_RECV(3)

socket_recv - Receives data from a connected socket

SYNOPSIS
int socket_recv (resource $socket, string &$buf, int $len, int $flags) DESCRIPTION
The socket_recv(3) function receives $len bytes of data in $buf from $socket. socket_recv(3) can be used to gather data from connected sockets. Additionally, one or more flags can be specified to modify the behaviour of the function. $buf is passed by reference, so it must be specified as a variable in the argument list. Data read from $socket by socket_recv(3) will be returned in $buf. PARAMETERS
o $socket - The $socket must be a socket resource previously created by socket_create(). o $buf - The data received will be fetched to the variable specified with $buf. If an error occurs, if the connection is reset, or if no data is available, $buf will be set to NULL. o $len - Up to $len bytes will be fetched from remote host. o $flags - The value of $flags can be any combination of the following flags, joined with the binary OR ( |) operator. Possible values for $flags +-------------+---------------------------------------------------+ | Flag | | | | | | | Description | | | | +-------------+---------------------------------------------------+ | | | | MSG_OOB | | | | | | | Process out-of-band data. | | | | | | | | MSG_PEEK | | | | | | | Receive data from the beginning of the receive | | | queue without removing it from the queue. | | | | | | | |MSG_WAITALL | | | | | | | Block until at least $len are received. However, | | | if a signal is caught or the remote host discon- | | | nects, the function may return less data. | | | | | | | |MSG_DONTWAIT | | | | | | | With this flag set, the function returns even if | | | it would normally have blocked. | | | | +-------------+---------------------------------------------------+ RETURN VALUES
socket_recv(3) returns the number of bytes received, or FALSE if there was an error. The actual error code can be retrieved by calling socket_last_error(3). This error code may be passed to socket_strerror(3) to get a textual explanation of the error. EXAMPLES
Example #1 socket_recv(3) example This example is a simple rewrite of the first example from "Examples" to use socket_recv(3). <?php error_reporting(E_ALL); echo "<h2>TCP/IP Connection</h2> "; /* Get the port for the WWW service. */ $service_port = getservbyname('www', 'tcp'); /* Get the IP address for the target host. */ $address = gethostbyname('www.example.com'); /* Create a TCP/IP socket. */ $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if ($socket === false) { echo "socket_create() failed: reason: " . socket_strerror(socket_last_error()) . " "; } else { echo "OK. "; } echo "Attempting to connect to '$address' on port '$service_port'..."; $result = socket_connect($socket, $address, $service_port); if ($result === false) { echo "socket_connect() failed. Reason: ($result) " . socket_strerror(socket_last_error($socket)) . " "; } else { echo "OK. "; } $in = "HEAD / HTTP/1.1 "; $in .= "Host: www.example.com "; $in .= "Connection: Close "; $out = ''; echo "Sending HTTP HEAD request..."; socket_write($socket, $in, strlen($in)); echo "OK. "; echo "Reading response: "; $buf = 'This is my buffer.'; if (false !== ($bytes = socket_recv($socket, $buf, 2048, MSG_WAITALL))) { echo "Read $bytes bytes from socket_recv(). Closing socket..."; } else { echo "socket_recv() failed; reason: " . socket_strerror(socket_last_error($socket)) . " "; } socket_close($socket); echo $buf . " "; echo "OK. "; ?> The above example will produce something like: <h2>TCP/IP Connection</h2> OK. Attempting to connect to '208.77.188.166' on port '80'...OK. Sending HTTP HEAD request...OK. Reading response: Read 123 bytes from socket_recv(). Closing socket...HTTP/1.1 200 OK Date: Mon, 14 Sep 2009 08:56:36 GMT Server: Apache/2.2.3 (Red Hat) Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT ETag: "b80f4-1b6-80bfd280" Accept-Ranges: bytes Content-Length: 438 Connection: close Content-Type: text/html; charset=UTF-8 OK. PHP Documentation Group SOCKET_RECV(3)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy