Tag:request

  • Go language web programming to realize get and post request sending and parsing

    Time:2020-3-22

    The example of this paper describes how to realize get and post request sending and parsing by go language web programming. To share with you for your reference, as follows: This is an introductory article, through a simple example to introduce the main technologies used in web programming of golang. The article structure includes: 1. […]

  • Comparison of various methods of getting URL information from JSP request

    Time:2020-1-6

    Various path information can be obtained from the request object, as shown in the following example: Assuming that the requested page is index.jsp and the project is webdemo, obtain various path information about the request object in index.jsp as follows String path = request.getContextPath(); String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”; String remoteAddress=request.getRemoteAddr(); String servletPath=request.getServletPath(); String realPath=request.getRealPath(“/”); String […]

  • Please save your request agent mode

    Time:2020-1-2

    What’s the proxy pattern? In fact, the agent model is to separate the classes that violate the principle of oneness and try to meet the principle of openness and closeness. The behavior equivalent to a class is just one, but you can add extra behavior to the class. For example, if a factory makes umbrellas, […]

  • PHP uses HTTP to request URL generic class

    Time:2019-12-31

    <?php /** *HTTP request class */ class HttpTool { protected $connect_timeout; protected $request_timeout; public function __construct($connect_timeout = 5, $request_timeout = 55) { $this->connect_timeout = $connect_timeout; $this->request_timeout = $request_timeout; } public function httpRequest($url, $data, $type = ‘POST’, $header = [], $opt = [], &$curl_info = []) { $ch = curl_init($url); $options = array( CURLOPT_HTTPHEADER => $header, […]

  • Preparing for interview / written examination: http knowledge that front-end programmers should not know

    Time:2019-12-15

    This article takes two days and is based on some interview questions that front-end interviewers often askPlease forgive me for any shortcomingsIf you think it will help you, please don’t be stingy with your praise^_^ 1. Http / TCP / IP / port overview The old rule, start with a story Mr. Gong went across […]

  • Thinkphp5.1 framework Routing:: get, post request simple usage example

    Time:2019-12-13

    This article describes the simple use of thinkphp5.1 framework route:: get, post request. To share with you for your reference, as follows: 1. Create a type method in the controller index under the index module public function type(){ var_dump(input()); Echo ‘I am the test type’; return view(); } 2. Under the index module, create a […]

  • Android intercepts and obtains WebView internal post request parameters

    Time:2019-12-12

    Cause: Sometimes the H5 page embedded in your app is not your own. But many times I want to obtain the parameters of H5 internal request without H5’s knowledge. How can I do this? With this question, there is this blog. Implementation process: Scenario 1: The first idea is to intercept all the requests in […]

  • Laravel framework request, response and session operation examples

    Time:2019-12-6

    This article describes the request, response and session operations of the laravel framework. To share with you for your reference, as follows: Request operation public function request(Request $request){ //1. value //echo $request->input(‘name’); //Echo $request – > input (‘sex ‘,’unknown’); /*if($request->has(‘name’)){ echo $request->input(‘name’); }else{ Echo ‘no such parameter’; }*/ //Get all parameters /*$res = $request->all(); dd($res);*/ […]

  • Android framework Volley USES: ImageRequest request to implement image loading

    Time:2019-10-23

    First we import the framework into the project: implementation ‘com.mcxiaoke.volley:library:1.0.19’ Add network permissions to the AndroidManifest file: <uses-permission android:name=”android.permission.INTERNET”/> Here is our homepage layout: In this layout we made all the features of the Volley framework into a single button, and when the button is pressed it will display the results under “show results”, using […]

  • Post request implementation method used by Android framework volley

    Time:2019-10-20

    First, we import this framework into the project: implementation ‘com.mcxiaoke.volley:library:1.0.19’ Add network permissions to the Android manifest file: <uses-permission android:name=”android.permission.INTERNET”/> Here is our homepage layout: In this layout, we have made a button for all the functions of the volley framework. After pressing the button, the result will be displayed under “display result”. A Scrollview […]

  • Talking about the problem that request. getinputstream can only be read once

    Time:2019-10-9

    First, let’s review the basic knowledge of the InputStream read method. There is a postion inside the Java InputStream read method, which marks the position read by the current stream. Every time it reads, the position moves. If it reads to the end, the InputStream. read method will return – 1. The mark has been […]

  • The SRC address of img is a request way to display images

    Time:2019-10-4

    1、jsp  <img alt=”test” src=”getImg2.do”> 2、controller @RequestMapping(“getImg2”) public void getImg2(HttpServletRequest request, HttpServletResponse response) throws IOException { FileInputStream fis = null; OutputStream os = null; try { fis = new FileInputStream(“d:/log.png”); os = response.getOutputStream(); int count = 0; byte[] buffer = new byte[1024 * 8]; while ((count = fis.read(buffer)) != -1) { os.write(buffer, 0, count); os.flush(); } […]