Convert HTTP Post form to Arduino Code

Could someone help me convert this form data into name value pairs, because I am getting errors. My plan is to convert to name value pairs, and then just use client.print() on the Arduino to replicate it.

because I am getting errors.

What errors? Where are these errors manifesting themselves?

When I post to via my browser it comes back saying that it did not failed because one of the values for a name was not received, but it works when I use the original form. This is all before putting it in arduino code. I just don't know how to attack an HTTP Post in arduino, but it would be nice if my code could be short name value pairs.

So its mainly from the top group of code working and the bottom group of code not working.

It looks as if the second HTML is intended to be defining a URL containing a set of name/value pairs, but I don't understand how the utcdatatime element you have added is supposed to relate to the URL that is posted - in any case, <utcdatatime="2013-06-16T23:20:40"&leftsource="1"&rightsource="1"&automatictransfer="1"&eventstatus="1"&preferred="1"> does not look to me like valid HTML. The original HTML fragment you posted defines a form with named fields which would automatically be encoded in the HTTP request when the form is submitted - what makes you think that a different approach is needed?

When I post to via my browser it comes back saying that it did not failed because one of the values for a name was not received, but it works when I use the original form.

When you post to what? What is "it" that comes back? Back to where? "It did not failed"? Did or did not? What is "it" that failed or didn't fail?

Feel free to post some pictures, if you need to. Feel free (even encouraged) to use nouns instead of pronouns.

The original post confused me. Good thing OP posted the form and the arduino code. Here is what I think you are doing: you have a form that gets posted to a server if you load it to a browser and press submit. You want arduino to post to the server instead. Right? You should go read some sample HTTP 1.1 POST headers to understand how to construct a proper header and content.
Half way down (almost), read what a post header looks like:

There is NO HTML tags in POST data. You had a few of those in your Arduino code.

By the way, your arduino code is not a real code. It will NEVER work. It is a 90% real 10% pseudo code. Look here:

    client.println("Host: website");

This won't print the actual content of char server[] but instead it will print Host: website. This is pseudo code. The real code should be:

client.print("Host: ");
client.println(server);

There are lots of places where similar things need changes before this even is called a real code.

I suggested to the moderators to have your thread moved here to get more exposure to the networking experts and others sharing the same type of question. You should formulate your POST request similar to this and have actual webhosts and etc. printed in place:

POST /foo.php HTTP/1.1  
Host: localhost  
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8  
Accept-Language: en-us,en;q=0.5  
Accept-Encoding: gzip,deflate  
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7  
Keep-Alive: 300  
Connection: keep-alive  
Referer: http://localhost/test.php  
Content-Type: application/x-www-form-urlencoded  
Content-Length: 43  
  
first_name=John&last_name=Doe&action=Submit

I think I might have made it be pseudo code myself... ;). But regardless. I think the difference is in the Content-Type line. I got one to work on my computer and this is what it looks like, is there any way to get rid of the boundary because that seems like a lot for the arduino.

I can just save the boundary as a char[] but let me know if anyone knows a way to shorten this code on the Arduino, and I still have yet to get my code working, but I think I will soon.

Edit: I also get an error on the second line due to the / as a string on Arduino

I posted a header and POST data I found online. Just read it! The data is one line after the header. It's the same as the way you were trying but didn't work. Why are you putting some boundary in?

That is what is given to me, can I just not put that and the server side won't care? I do not have control over the server side. Are the boundary or the content-disposition required usually?

From my limited understanding, your data below

utcdatatime="2013-06-16T23:20:40"&leftsource="1"&rightsource="1"&automatictransfer="1"&eventstatus="1"&preferred="1"

replaces my example portion:

first_name=John&last_name=Doe&action=Submit

I am not too sure whether you can use any characters in your data. I would remove the quotes and look at URI encoding if I needed some special characters as part of my data:

Your ":" character may need encoding, according to the above reference. I don't know anything about boundaries so can't help with that. But how did you jump from your original "non-working code" below to boundary?

<html>
<body>
    <form action="website"
        enctype="multipart/form-data" method="post">
        <utcdatatime="2013-06-16T23:20:40"&leftsource="1"&rightsource="1"&automatictransfer="1"&eventstatus="1"&preferred="1">
    </form>
</body>
</html>

I used the HTTP form, the "working" one, alongside with fiddler2. I then took the success form data post, and printed out the RAW file associated. So I monitored the form, and it shows the RAW post that actually happened.