Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:34:15+00:00 2026-05-26T18:34:15+00:00

I have been reading up on using webrequests and post and get methods to

  • 0

I have been reading up on using webrequests and post and get methods to submit an online form but I am very lost. The webform resides on a page full of other hyperlinks, but viewing the source code it says method=get in one spot and method=post in another. The method=get is located in the code near information regarding a search bar though so I believe that applies to that function. The 2 text fields I want to fill before submitting are listed as “name=weblink” and “name=imageurl”, so lots of the examples I’ve seen using id values doesn’t seem to apply. The “Save” button is identified as

input type="submit" value='Save Changes'

Currently this is what my code looks like:

try
            {
//store our text box information as variables to be uploaded
                string picture = txtbxPicture.Text,
                 weblink = txtbxWeblink.Text,
                 uriString = txtbxWebLink.Text;

                // Create a new WebClient instance.
                WebClient myWebClient = new WebClient();

                // Create a new NameValueCollection instance to hold some custom parameters to be posted to the URL.
                NameValueCollection collection = 
                    new System.Collections.Specialized.NameValueCollection();

                collection.Add("weblink", weblink);
                collection.Add("imageurl", picture);                   

                byte[] result = myWebClient.UploadValues(uriString, collection);

            }
            catch (FormatException ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }

If I understand everything correctly I’m using the NameValueCollection to look for fields based on their “name”? This code was compiled using primarily MSDN’s info here: http://msdn.microsoft.com/en-us/library/9w7b4fz7.aspx

I have seen a lot of other examples that use encoding, and explicitly identify that it is a “POST” method, but MSDN says it’s implied? I’m basically lost here. Can someone offer a little guidance, the current threads out there are just making me more confused.

UPDATE – So identifying post doesn’t seem to be necessary, but is possible. What about clicking the submit button is that something that I need to be coding in but am not? I don’t understand what my code above needs to do in order to complete the process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:34:16+00:00Added an answer on May 26, 2026 at 6:34 pm

    WebClient.UploadValues() will use POST over HTTP by default, you don’t have to specify that (you may though if you need to, there’s an overload of the method that does allow you to).

    From MSDN:

    This method uses the STOR command to upload an FTP resource. For an
    HTTP resource, the POST method is used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading around about people using J#. But my question is: What
I have been reading about using nHibernate and multiple datasources and I get the
I have been reading that creating dependencies by using static classes/singletons in code, is
I have been reading up on porting ASP.NET Membership Provider into .NET 3.5 using
I am using Codeigniter to develop an application, and have been reading bits about
I have been reading about the kernel using timers for thread synchronization. I haven't
I have been reading about creating offline websites using Gears and using HTML 5.
I have been reading a few articles which describe using a Datavault and tokenisation
I have been reading page after page after page about the benefits of using
I have been reading about dependency properties in several books but all have one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.