Due to project testing needs, when writing a robot, I used Erlang's httpc to send a POST request to the server. I made a record myself and forgot it later.
You can see the following example:
T. erl
-Module (t ). -Export ([t/0]). -Define (name, "hosr "). -Define (passwd, 112233 ). T ()-> inets: Start (), SSL: Start (), Case httpc: Request (post, {"http: // 1
Turn a picture into a binary stream using the afnetworking POST to upload to the server.Afhttprequestoperationmanager *manager = [[Afhttprequestoperationmanager alloc] Initwithbaseurl:[nsurl URLWithString : BaseUrl]];Manager.responseserializer = [Afjsonresponseserializer serializer]; Manager.requestSerializer.timeoutInterval = timeOutInterval; [Manager Post:request_updatecompanyinfo parameters:paramdict constructingbodywithblock:^ (id NSData *data=uii
Preface:
Study-PHP started in the past two days. By the way, I was familiar with JavaScript, HTML, and so on. I found a lot of problems and had to, instead of reading the RFC-doc in E @__@. I am not very good at E-text, headache ing ....
This article is mainly a small attempt, hoping to use a method similar to Ajax, without refreshing post data to the background.
On the network, we can see that the XMLHTTP. setRequestHeader () method needs to be call
1. Get Method
Method: add the corresponding data after the URL, such as http: // 172.22.35.112: 8080/videonews/getinfoservlet? Title = Hobbit timelength = 100;
Disadvantage: the data submitted in get mode can only send less than 2 K of data, which is suitable for sending small-capacity data. In addition, if the data sent is in Chinese, you need to perform garbled processing on the URL and the server (set the encoding mode to display Chinese cha
In my previous article, I described using get to submit data to a Tomcat server, which would introduce the use of post to submit data to a server, which is exactly the same as creating a Web project with a get way, in just a few different places. I'll just introduce the different places, the first difference is that the submissions are different, so modify the co
write*/ + while(Len=in.read (arr))!=-1){ -Bos.write (arr, 0, Len); + } A byte[]b=Bos.tobytearray (); at return NewString (b,0, b.length); - } - - - - return NULL; in}/*** Utility class to get server resources** Post method transmits data** 1. Set the transmission mode via path* 2. Create client* 3. Get input stream*
Gateway Interface CGI and Microsoft Information Server application interface ISAPI is development interaction
Web applications commonly used in two types of interface, CGI is based on the Web server and the relationship between the database services
The end of the process, it can complete the bottom of the database operation, the customer through the get/post to
Note: Data returned from the server should be processed in handlemessage. Otherwise, the results will not be obtained due to thread issues.
Public class mainactivity extends activity {private string responseinfo; private handler; @ override protected void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. activity_main); handler = new handler () {@ override public void handlemessage (Message MSG) {su
Write extension, unable to access global variables such as $ _ post, $ _ Get, $ _ server, etc,
The following are provided by yaf:Code, I removed the yaf-related macros...
1/** Yaf documentationHttp://yaf.laruence.com/manual/**/
2
3
4 Zval * yaf_request_query (
Uint Type,
Char * Name,
Uint Len tsrmls_dc ){
5 Zval ** carrier, ** ret;
6
7
# If (Php_major_version = 5) (php_minor_versi
The last thing that comes to mind is the need to implement a Web server to process the request, and then send the message to another program. The result is then returned to the processing and rendered.Now I'm going to share a little bit about how it's achieved.The HttpListener class provided by. NET implements the processing of the HTTP protocol and implements a simple Web server.Note: This class is new in the. NET Framework version 2.0. Therefore, su
better handled:1 if(isset($_get[' Name ']) !Empty($_get[' Name '])) {2 $username=Trim($_get[' Name ']);3 if(file_put_contents(' Data-demo01 ',$username)) {4 Echo' {' Result ': 1} ';5}8}(2) Front-end Ajax initiating POST requestJS code needs to modify the next Ajax () URL, method parameter, and add a data parameter, modified as follows:1 //The same Code omitted 2 $.ajax ({3 URL: ' demo01.php ',4 dataType: ' JSON
jquery's deferred object.2, the back end of the PHP code running on the Nginx serverThe logic behind the backend is simple: we save the data from the front end to a file named Data-demo01, and the Save succeeds returns a 1 as a flag to the front end.(1) Front-end Ajax initiating GET requestIf the front-end Ajax initiates a GET request, then the backend is also better handled: if (isset ($_get[ ' name " ]) !empty ($_get[ " name " )) {$username = Trim ($_get[ " name " ]); if (file_put_
Fsockopen
to Socket Way to open a connection
my most common use is simulation. Post
this is from Xiao Li's excavation. ... Good
as to the simulation Get Way .... Direct file_get_content it's okay. .
Code See back
Stream_socket_client, code See back
this and Fsockopenfsockopen same . to Socket Way to open a connection , just different parameters .
Stream_socket_server
Build a Socket
This is a creation in
Article, where the information may have evolved or changed.
The Go language provides an HTTP package that makes it easy to develop an HTTP interface. The following is the sample code:
Package Webserverimport ("Encoding/json" "FMT" "Net/http" "Time") func webserverbase () {fmt. Println ("This is webserver base!") The first parameter is the interface name when the client initiates an HTTP request, and the second parameter is a func that is responsible for processing the requ
Playframework server accepts post Multipart/form-data requests and receives multiple files sent from client side
static SimpleDateFormat SimpleDateFormat = new SimpleDateFormat ("YyyyMMdd");
public static void Getuploadfile (string file) {string Datadirname=simpledateformat.format (new Date ());
String path= "/home/accept/" +datadirname+ "/";
File Tosave = new file (path);
================================== Declaration ==================================This article is original, reproduced in the text of the influential annotated author and source, and to ensure the integrity of the article.Do not modify (including this statement) without the consent of the author, and reserve the right of legal investigation.Do not use for publication, printing or academic reference without the consent of the author.In order to ensure the correct contents, we suggest that we shoul
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.