Tag:http

  • Summary of HTTP related optimization in front end optimization

    Time:2019-12-10

    Learning and summary articles are published synchronously at https://github.com/xianshanna…, if you are interested, you can pay attention to them and learn and progress together. HTTP optimization is an important part of front-end performance optimization, and also one of the necessary knowledge points of front-end. Reduce static resource file size This is the most fundamental way. […]

  • Swoole learning network communication engine Web Service (4)

    Time:2019-12-9

    I. HTTP service HTTP server Let’s look at the introduction guide to swoole official documents – > fast start – > create a web server, run the sample code of the document once, and see the following effect: http_server.php <?php $http = new Swoole\Http\Server(“0.0.0.0”, 9501); $http->on(‘request’, function ($request, $response) { var_dump($request->get, $request->post); //Cookie test // […]

  • Session and login mechanism

    Time:2019-12-9

    githubAddress: stamp here session concept A solution for maintaining state between client and server The storage structure of this solution Characteristic BecauseSessionIt is stored in the form of a text file on the server side, so it is not afraid of the client modifying the session content. (you can also use other storage methods such […]

  • Make NG’s $HTTP service as easy to use as jquerr. Ajax()

    Time:2019-12-8

    Author ZekeMany beginners of NG have such a puzzle: why the $HTTP service, such as $http. Post(), is similar to jQuery’s $. Post(), but can’t be replaced directly, for example: (function($) { jQuery.post(‘/endpoint’, { foo: ‘bar’ }).success(function(response) { // … }); })(jQuery); Such code does not work properly in ng. var MainCtrl = function($scope, $http) […]

  • Java HTTP tool class

    Time:2019-12-8

    HTTP request tool I. add dependency <dependency> <groupId>cn.gjing</groupId> <artifactId>tools-httpclient</artifactId> <version>1.2.1</version> </dependency> II. Instructions The return value type should preferably be the same as the target methodOtherwise, conversion exceptions may occur, which is best used when the return type is not confirmedStringTo receive. At the end of the request, you can use theget()Method can also be […]

  • About the record of HTTP code 308

    Time:2019-12-7

    Recently, a file upload function is needed in the project. The component used is elementDuring the test, the upload component of UI found that the status returned by the backend is 308 permanent redirection. During the upload process, not only the request to upload the file itself, but also aSeemIrrelevant requests, through the query of […]

  • Lua web rapid development guide (7) – efficient interface call – httpc Library

    Time:2019-12-7

    Httpc library is based on HTTP client library written by socket which is implemented in CF framework The httpc library has built-in SSL support, which enables you to request third-party interfaces without using a proxy Httpc supports header, args, body and timeout request settings, and perfectly supports various httpc call modes API introduction Httpc library […]

  • Get post difference

    Time:2019-12-6

    Get post difference In general, get is used to read resources from the server, and post is used to upload data to the server, such as uploading forms Get usually uses the URL to deliver messages to the server. The URL length is generally limited by browsers, intermediate nodes, servers, etc. post can deliver data […]

  • Golang HTTP connection reuse method

    Time:2019-12-6

    Server terminal Golang httpserver enables the keepalive connection reuse option by default The handler function needs to read the body data completely and construct the return message. Otherwise, when the data cannot be sent at one time, the connection multiplexing will fail. Examples are as follows package main import ( “fmt” “io/ioutil” “log” “net/http” “os” […]

  • After using HTTP for so long, do you know the content length?

    Time:2019-12-5

    Abstract:Understand HTTP protocol Original text: after using HTTP for so long, do you know content length and transfer encoding? Author: Park Ruiqing’s blog A series of thinking caused by content length problems:Some time ago, API gateway was developed. There was a timeout when using postman for debugging. It was determined that the request data was […]

  • The implementation of downloading files with HTTP client in golang

    Time:2019-12-5

    Before using beego’s HTTP library, sometimes you need to download files. Beego can be implemented, but there is a problem: it does not support callback and cannot display download speed, which is intolerable in daily development. I have seen that the implementation of beego mainly uses the io.copy function, so I have a deep look […]

  • Talking about the keep alive mechanism in HTTP and the keep alive mechanism in Java http

    Time:2019-12-4

    What is keep alive This word looks familiar. I’ve seen it in many places. TCP keepalive, HTTP keepalive. Now even some front-end frameworks have something similar to keepalive (such as vue.js, keep route). This article introduces the keepalive mechanism in HTTP and TCP. Other aspects are not covered in this article. Keep alive in http […]