Hello I'm writing a web server in python(obelisk-http.sourceforge.net)
and I'm having a greeat problem with POST method it like that
When someone make a POST request to the server it must open the executable(perl/python/.exe/elf) and send to the STANDART in (stdin) the request and get the response.
when i send the request to stdin of any binarie(.exe or elf) works
but when i try to use a script it don't read the stdin I'm using a code like that
script.py:
ok, but it don't work :\
someone have an ideia?
you are also not using the methods you imported from subprocess..I assume you are going to used them later?
thesubprocess s module in later Python version is meant to replace os.popen* and other older methods.
last point : its better to structure your script.py so that you can import them into your script, instead of calling them from the shell..an example of what i mean
script.py
then from your main script, you do:
then you can use printstdin().
Hi
The following is my program to test popen()
routine. The purpose is to print some contents
of the corrent directory.
But in fact, the output is only one character
'a', which I believe is the first char of the file
"a.out".
So, can anybody tell me what is wrong about
this program?... (2 Replies)
hai friends
I have written a tcp chat server in c.. I have designed a cgi program in c to control it... When i try to start the server from the cgi program, it is not starting. Why is that ? I have even tried giving the root ownership for all the programs.. Still its not.
I have used the... (1 Reply)
Hi there,
I'm facing a problem running the tar command with the popen function.
FILE* fp = popen("tar czf - textfile","r")
// output
this program should give the output to the stdout. I don't know if it is possible and which function like fprint() etc. should I use.
I suppose that I... (4 Replies)
hi,
how to work with a background process without a controlling terminal to make use of popen or system call ?
when ever i use popen or system function call in foreground process, there is no problem with respect to that .. but when the same program is run as a background process without a... (7 Replies)
Hi All,
I have to upgrade python installed on my Redhat enterprise Linux 4. I downloaded the latest python package from python website but not able to install the new package as the make command itself goes on running for more than a day. Can some help me regarding this. Is ther any method to... (2 Replies)
Hi!
I'm trying to write a c program. The child process must transmit to the parent a file name and the parent must count the lines from the file and return te result to the child. Here is what i've done. It doesn't stop running, I guess. I'm sorry if it's an ugly code, i'm new at this stuff,... (2 Replies)
Hello all,
I am reading a huge zip file in POPEN process and then writting that to a normal file which of 2GB. Now the process is failing when I looked for the cause someother process comming in after I read my file and it is deleting the zip. But in theory the popen command should read the... (5 Replies)
Hello everyone ,
I need your help to end my python code.
I've this code in python :
from ipywidgets import interact, Dropdown
from ipywidgets import *
from ipywidgets.embed import embed_minimal_html
import pandas as pd
import os
import sys
#################### Dropdown servers... (1 Reply)
Discussion started by: Tim2424
1 Replies
LEARN ABOUT MOJAVE
curlopt_customrequest
CURLOPT_CUSTOMREQUEST(3) curl_easy_setopt options CURLOPT_CUSTOMREQUEST(3)NAME
CURLOPT_CUSTOMREQUEST - custom string for request
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CUSTOMREQUEST, char *request);
DESCRIPTION
Pass a pointer to a zero terminated string as parameter.
When you change the request method by setting CURLOPT_CUSTOMREQUEST(3) to something, you don't actually change how libcurl behaves or acts
in regards to the particular request method, it will only change the actual string sent in the request.
Restore to the internal default by setting this to NULL.
This option can be used to specify the request:
HTTP Instead of GET or HEAD when performing HTTP based requests. This is particularly useful, for example, for performing a HTTP DELETE
request.
For example:
When you tell libcurl to do a HEAD request, but then specify a GET though a custom request libcurl will still act as if it sent a
HEAD. To switch to a proper HEAD use CURLOPT_NOBODY(3), to switch to a proper POST use CURLOPT_POST(3) or CURLOPT_POSTFIELDS(3) and
to switch to a proper GET use CURLOPT_HTTPGET(3).
Many people have wrongly used this option to replace the entire request with their own, including multiple headers and POST con-
tents. While that might work in many cases, it will cause libcurl to send invalid requests and it could possibly confuse the remote
server badly. Use CURLOPT_POST(3) and CURLOPT_POSTFIELDS(3) to set POST data. Use CURLOPT_HTTPHEADER(3) to replace or extend the set
of headers sent by libcurl. Use CURLOPT_HTTP_VERSION(3) to change HTTP version.
FTP Instead of LIST and NLST when performing FTP directory listings.
IMAP Instead of LIST when issuing IMAP based requests.
POP3 Instead of LIST and RETR when issuing POP3 based requests.
For example:
When you tell libcurl to use a custom request it will behave like a LIST or RETR command was sent where it expects data to be
returned by the server. As such CURLOPT_NOBODY(3) should be used when specifying commands such as DELE and NOOP for example.
SMTP Instead of a HELP or VRFY when issuing SMTP based requests.
For example:
Normally a multiline response is returned which can be used, in conjunction with CURLOPT_MAIL_RCPT(3), to specify an EXPN request.
If the CURLOPT_NOBODY(3) option is specified then the request can be used to issue NOOP and RSET commands.
The application does not have to keep the string around after setting this option.
DEFAULT
NULL
PROTOCOLS
HTTP, FTP, IMAP, POP3 and SMTP
EXAMPLE
TODO
AVAILABILITY
IMAP is supported since 7.30.0, POP3 since 7.26.0 and SMTP since 7.34.0.
RETURN VALUE
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
SEE ALSO CURLOPT_HTTPHEADER(3), CURLOPT_NOBODY(3),
libcurl 7.54.0 December 21, 2016 CURLOPT_CUSTOMREQUEST(3)