简体   繁体   中英

Writing HTTP POST request

I'm trying to send the contents of a file in a HTTP POST request to the eBay File Exchange. The problem is I have no knowledge of how to even start this. Can I do all of this in PHP or maybe JQuery. I've watched a few tutorials, but am just really stuck. Does anyone have any pointers on how I can start learning. Thanks

Have you taken a look at the official docs ? I assume you have a basic understanding of what POST requests are, and how they differ from GET. The JQuery page I linked you to uses a technique known as AJAX, which allows data to be transferred asynchronously. This basically means there won't be a page reload and the information will be passed in the background.

You can do like this:

$.post( "example.php", function() {
  alert( "success" );
})
.done(function() {
  alert( "second success" );
})
.fail(function() {
  alert( "error" );
})
.always(function() {
  alert( "finished" );
});

For some other informations go to https://api.jquery.com/jquery.post/

or http://www.w3schools.com/jquery/ajax_post.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM