Performance tests for encapsulating data in HTTP using JSON

Source: Internet
Author: User

Performance tests for encapsulating data in HTTP using JSON A project uses JSON to encapsulate data, interfaces such as:  client send:  post/list.do http/1.1 host:zoomi.com.cn connection:close  Accept: */ *    cookie:sessionid=ea277024eceb83494a0c490981f57d57 content-length:100    {"Action": "Get", "target": "Broadcast_thread_list", "type": "All"}    the server returns:  http/1.1 ok content-length:100   {"Action": "Get", "target": "Broadcast_thread_list", " Result ":0,  " type ":" All ", " content ": [, 1001, 1002 ...]        //Post ID list, The post ID is int type  }   script as follows    action ()  { web_add_header ("Host", "zoomi.com.cn");   web_add_header ("Connection", "close"),   //web_add_header ("Accept", "*/*");   // Web_add_header ("Cookie", "sessionid=ea277024eceb83494a0c490981f57d57");  //cookie has not yet implemented    //web_add_header ("Content-length", "100");  //If you add this script, the reason is not known web_add_header ("X-uid", "three"); Web_custom_request ("broadcast",  //write a name      "Method=post",  //  "resource=1",                        //Request method, this thing does not also can, is not the resources do not need it   &NBS P "Url=http://10.60.30.27:8080/childrearing/list.do",        //request address  //  "url=http:// 10.60.30.28:80/list.do ",     " Reccontenttype=application/json ",    //specifies the content-type of the response header, This is json    "Enctype=application/json",              //Specify the Content-type of the request header, Here is also json //  "mode=html",    "body={" action ":" Get "," target ":" Broadcast_thread_list "," type ":" All "}", //  "targetframe=",  // raw_body_start,             &NB Sp        //request body start identifier  //  "{" Action ":" Get "," target ":" Broadcast_thread_list "," type ":" All "}", // 78,       &NBSp                            //The length of the body content in the above line  //  raw_body_end,                  //request BODY end identifier     last); &nbsp ;//Explain, in fact, the JSON data in the BODY, or use the Raw_body_start function can be. Here is a convenient figure for the body. Note, however, that you want to escape the double quotation mark with a backslash, which is shown in Vugen as a ¥return 0;}

Performance test for encapsulating data using JSON in HTTP

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.