473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Post Data from Form to webpage through HTTP

rrocket
116 100+
I have been looking all over trying to find a simple example of how this is done... Basically I want to send info from a form to another website API via XML and get the information they send back to me.

If anyone has any examples or knows of any sites that explain it clearly please let me know.

I am trying to write it in C# .NET 2.0...
Dec 20 '07 #1
8 1403
Plater
7,872 Expert 4TB
Have you tried javascript's XMLHttpRequest object?
Dec 21 '07 #2
rrocket
116 100+
No, but I might give it a shot. Although I would rather do it in the C# codebehind.
Dec 21 '07 #3
Plater
7,872 Expert 4TB
oh!
I didn't realize code behind was an option.
Check out HttpWebRequest then. You can do all kinds of usefull stuff with that.
Dec 21 '07 #4
rrocket
116 100+
What is the best way to store the XML string? Is there something built it that will make things easy or is the best/only way to just store the entire XML string in a variable?
Dec 24 '07 #5
Plater
7,872 Expert 4TB
Hmm, well there's XMLDocument, don't know much about it though.
I'd just go with a string. DataTables support writing XML to a file, not sure if you can have it just write to a string from datatable.
Dec 26 '07 #6
rrocket
116 100+
Do you have any idea of how to get the action and version into a node?

For example:
Expand|Select|Wrap|Line Numbers
  1. <Shipment action="RateEstimate" version="1.0">
I cannot use LoadXML since I need to use it to loop through a few things later in the code.

I am adding the other nodes with:
Expand|Select|Wrap|Line Numbers
  1. XmlElement street = doc.CreateElement("street");
  2. street.InnerText = "something";
  3. doc.LastChild.LastChild.AppendChild(street);
  4.  
but cannot figure out how to get the extra text inside the <>.
Dec 27 '07 #7
Plater
7,872 Expert 4TB
I'm not really familiar with using the XML stuff, but I think there's an .SetAttribute() function of some sort, that should do it.
so on your shipment node you would go like:
.SetAttribute("action", "RateEstimate")
Dec 27 '07 #8
rrocket
116 100+
Cool thanks... It worked!
Dec 27 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
2
by: Keith Selbee | last post by:
I am trying to submit data to a webpage in the form of a post and my code is below. It is a function that takes a url and the post content as strings and then performs the post. But as soon as I...
7
by: Matt | last post by:
Hi all, Not very sure about this. I have one button (not a submit button) will "post" partial page(form) info to another url(the user will also redirect to this url :-). I dont' want to change...
5
by: John Bradley | last post by:
Toooo tired to look this one up. I have data that I need to acces in a small program. The data is accessable from an ASP webpage that I created myself. If I need to see data from record #25, I...
8
by: Smoke | last post by:
Does anyone has any example on how to make a POST Form to a page using VB.net (not asp.net) ? Thanks...
2
by: Ben | last post by:
Hi I have the two funcions below, login_web that posts data to a webpage and fcn_parseviewstate that parses the viewstate data for the post. I have a problem with the strPostData, I have been...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
0
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302...
6
by: Mark B | last post by:
I have a function that looks up a SQL table to see if a search term matches. It works fine but so far there are two things yet to work: 1) After entering a search term and pressing Enter, nothing...
5
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.