Hi, for some reason my POST is not working properly. I am basically
just trying to get a simple stock quote from yahoo by posting the
ticker symbol (GE as an example) into finance.yahoo.c om. However, when
I POST, I do get a response back, but it is just the main page
finance.yahoo.c om and it doesn't seem as if the POST got through. I am
using Python 2.2. I get a status and reason of 200 and OK
respectively. I've searched through these groups on previous POST
problems, but none have seemed to help so far. Any help would be
greatly appreciated, or if there is a previous post that describes this
same problem, please let me know.
In addition, when I change the headers from back and forth between
"multipart/form-data" and "applicatio n/x-www-form-urlencoded", there
seems to be no change. How do I know which Content-type to use for
each page. When I look at the Content-type on the yahoo page, it says
"text/html; charset=iso-8859-1" -- but if I enter this in, I get other
errors. How do I know which Content-type to use when I pass it as
headers?
Thank you very much.
############### ############### ############### #########
import urllib,httplib
url = "finance.yahoo. com"
fields = { "s": "ge" }
params = urllib.urlencod e(fields)
##headers = {"Content-type": "applicatio n/x-www-form-urlencoded",
## "Accept":"t ext/plain"}
headers = {"Content-type": "multipart/form-data",
"Accept":"t ext/plain"}
httpSess = httplib.HTTPCon nection(url)
httpSess.reques t("POST","/",params,header s)
response = httpSess.getres ponse()
print "status=%s, reason=%s" % (response.statu s,response.reas on)
data = response.read()
print "OUTPUT = \n\n%s\n\n" % data
############### ############### ############### ######### 2 1785
vm wrote: Hi, for some reason my POST is not working properly.
Look at the URL again, you missed a character. You had:
httpSess.reques t("POST","/",params,header s)
It should be:
httpSess.reques t("POST","/q",params,heade rs)
--
Benji York
Benji - that worked like a champ - my mistake. thanks
Vinod This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mad Scientist Jr |
last post by:
How do you get a ASP.NET page to return nothing, so the page posting
form data to it doesn't reload?
I have tried all combinations of the following:
Response.SuppressContent = True
Response.BufferOutput = True
Response.Cache.SetNoStore()
|
by: arfeengodil |
last post by:
Hi,
I need to have a web application such that other applications should be
able to do send data to it using HTTP Post.
So I created a ASP.NET web service and defined a web method for other
people to POST data to. But the string returned back to the person who
sent the POST message is embedded in XML Tags.
for example
http://mydomain.com/webserver.asmx/SendData?parameter=Hello World
|
by: Dean Hallman |
last post by:
Hello,
I am developing a BHO that should add a custom HTTP header on a
specific domain only. Don't want the header globally, otherwise I
could just add a registry key.
So, on BEFORENAVIGATE2, I am canceling the current navigation and
renavigating with the new custom header using Navigate2. This usually
works fine, but in some cases (particularly when selecting a link that
starts a new window), the Navigate2 call fails.
|
by: Tony Stephens |
last post by:
Hi,
I've created a small forms based application in c# to test a vendor's
product and the web service interface that it exposes. We have deployed two
instances of the vendor product one which has an unprotected (no
authentication) interface and one that is protected using HTTP basic
authentication.
I can invoke methods on the unprotected instance and everything's fine. When
I attempt to invoke methods on the protected instance the...
|
by: rynato |
last post by:
I have a form which the user fills out to enter some data.
If there already exists an uncompleted session - say, the user started
entering some data but had to stop to do something else - the user has
the option of selecting that session from a drop-down menu (think
<form><select><option>....</option></select></form>). The method for
that particular form is set to 'GET' and the action is
$_SERVER. The <selecttag has a bit of javascript...
| |
by: Atli |
last post by:
Hi everybody.
After years of C# and PHP, I'm finally returning to Java.
My goal is to create a Java program capable of sending images to a PHP Photo Album on my web server.
Right now, however, I am stuck trying to send simple text variables through POST to my PHP script.
The code does seem to connect to the script like it is supposed to, but it seems unable to send the POST variables. The PHP script is returning a 'Undefined index'...
|
by: pauldepstein |
last post by:
Below is posted from a link for Stanford students in computer
science.
QUOTE BEGINS HERE
Because of the risk of misuse, some experts recommend never returning
a
reference from a function or method.
QUOTE ENDS HERE
I have never heard anyone else say that it is a problem for a function
|
by: =?Utf-8?B?U3ViYQ==?= |
last post by:
Hi
I having a similar issue.
my website url has https://blahblahblah but when i do
Response.Write(Request.Url); it writes the url with http..........its really
strange........i dont have a clue why the url in my browser has https and
request.url has http...........
using the request object i am not able to get the scheme whether its http or
|
by: Guy Davidson |
last post by:
Hi Folks,
I'm having some issues with an small socket based server I'm writing,
and I was hoping I could get some help.
My code (attached below) us supposed to read an HTTP Post message
coming from a power meter, parse it, and return a proper HTTP 200 Ok
message. The problem is that the socket fails to send the entire
message as one message, creating a fragmented message which the power
meter then fails to read and accept.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |