post

java基础知识

拜拜、爱过 提交于 2020-03-01 22:47:55
1.final 关键字主要用在三个地方:变量、方法、类。 对于一个 final 变量,如果是基本数据类型的变量,则其数值一旦在初始化之后便不能更改;如果是引用类型的变量,则在对其初始化之后便不能再让其指向另一个对象。 当用 final 修饰一个类时,表明这个类不能被继承。final 类中的所有成员方法都会被隐式地指定为 final 方法。 使用 final 方法的原因有两个。第一个原因是把方法锁定,以防任何继承类修改它的含义; 2.static 关键字主要有以下四种使用场景? 修饰成员变量和成员方法: 被 static 修饰的成员属于类,不属于单个这个类的某个对象,被类中所有对象共享,可以并且建议通过类名调用。被static 声明的成员变量属于静态成员变量,静态变量 存放在 Java 内存区域的方法区。调用格式:类名.静态变量名 类名.静态方法名() 静态代码块: 静态代码块定义在类中方法外, 静态代码块在非静态代码块之前执行(静态代码块—>非静态代码块—>构造方法)。 该类不管创建多少对象,静态代码块只执行一次. 静态内部类(static修饰类的话只能修饰内部类): 静态内部类与非静态内部类之间存在一个最大的区别: 非静态内部类在编译完成之后会隐含地保存着一个引用,该引用是指向创建它的外围类,但是静态内部类却没有。没有这个引用就意味着:1. 它的创建是不需要依赖外围类的创建。2.

HTTP协议的8种请求类型介绍

喜欢而已 提交于 2020-03-01 13:42:06
HTTP协议中共定义了八种方法或者叫“动作”来表明对Request-URI指定的资源的不同操作方式,具体介绍如下: OPTIONS:返回服务器针对特定资源所支持的HTTP请求方法。也可以利用向Web服务器发送'*'的请求来测试服务器的功能性。 HEAD:向服务器索要与GET请求相一致的响应,只不过响应体将不会被返回。这一方法可以在不必传输整个响应内容的情况下,就可以获取包含在响应消息头中的元信息。 GET:向特定的资源发出请求。 POST:向指定资源提交数据进行处理请求(例如提交表单或者上传文件)。数据被包含在请求体中。POST请求可能会导致新的资源的创建和/或已有资源的修改。 PUT:向指定资源位置上传其最新内容。 DELETE:请求服务器删除Request-URI所标识的资源。 TRACE:回显服务器收到的请求,主要用于测试或诊断。 CONNECT:HTTP/1.1协议中预留给能够将连接改为管道方式的代理服务器。 虽然HTTP的请求方式有8种,但是我们在实际应用中常用的也就是get和post,其他请求方式也都可以通过这两种方式间接的来实现。 HTTP协议中GET、POST和HEAD的介绍 2008-05-10 14:15 GET: 请求指定的页面信息,并返回实体主体。 HEAD: 只请求页面的首部。 POST: 请求服务器接受所指定的文档作为对所标识的URI的新的从属实体。

Microphone Array Post-Filtering

微笑、不失礼 提交于 2020-03-01 13:04:30
Abstract 摘要 High level of noise reduces the perceptual quality and intelligibility of speech. Therefore, enhancing the captured speech signal is important in everyday applications such as telephony and teleconferencing. Microphone arrays are typically placed at a distance from a speaker and require processing to enhance the captured signal. Beamforming provides directional gain towards the source of interest and attenuation of interference. It is often followed by a single channel post-filter to further enhance the signal. Non-linear spatial post-filters are capable of providing high noise

3.手机是否存在验证接口

与世无争的帅哥 提交于 2020-03-01 10:56:07
后台 urls.py path('mobile/', views.MobileViewSet.as_view({'post': 'check'})), views.py # 手机是否存在接口 import re class MobileViewSet(ViewSet): def check(self, request, *args, **kwargs): mobile = request.data.get('mobile', None) if not mobile: return APIResponse(1, 'mobile field required') if not re.match(r'^1[3-9][0-9]{9}$', mobile): return APIResponse(1, 'mobile field error') try: models.User.objects.get(mobile=mobile) return APIResponse(result=True) # 手机号存在 except: return APIResponse(result=False) # 手机号不存在 来源: https://www.cnblogs.com/kai-/p/12388519.html

jQuery.post网摘

六月ゝ 毕业季﹏ 提交于 2020-03-01 04:32:56
准备工作 ·Customer类 public class Customer { public int Unid { get; set; } public string CustomerName { get; set; } public string Memo { get; set; } public string Other { get; set; } } jQuery.post( url, [data], [callback], [type] ) ·url:加载页的地址 ·data(optional):k/v对或序列化的字符串(.serialize()),参数 ·callbakc(optional):数据成功加载后的执行函数 ·type(optional):请求返回的数据格式,串型 (一)ashx文件 (1)请求单实体数据 ·Ashx文件,这里不对返回的数据做显式的序列化。 Customer customer = new Customer { Unid = 1, CustomerName = "宋江", Memo = "天魁星", Other = "黑三郎" }; context.Response.Write(customer); ·ajax post function GetCustomer_Ashx() { $.post( "webdata/post_1.ashx",

Jquery的.post说解

大兔子大兔子 提交于 2020-03-01 04:32:42
Jquery的.post说解(一) 准备工作 ·Customer类 public class Customer { public int Unid { get; set; } public string CustomerName { get; set; } public string Memo { get; set; } public string Other { get; set; } } jQuery.post ( url, [data], [callback], [type] ) ·url:加载页的地址 ·data(optional):k/v对或序列化的字符串(.serialize()),参数 ·callbakc(optional):数据成功加载后的执行函数 ·type(optional):请求返回的数据格式,串型 (一)ashx文件 (1)请求单实体数据 ·Ashx文件,这里不对返回的数据做显式的序列化。 Customer customer = new Customer { Unid = 1, CustomerName = "宋江", Memo = "天魁星", Other = "黑三郎" }; context.Response.Write(customer); ·ajax post function GetCustomer_Ashx() { $.post(

jQuery的.post

送分小仙女□ 提交于 2020-03-01 04:32:14
jQuery的.post (2011-04-27 00:33:11) 转载 标签: 杂谈 一、准备工作·Customer类 public class Customer { public int Unid { get; set; } public string CustomerName { get; set; } public string Memo { get; set; } public string Other { get; set; } } 二、定义:jQuery.post( url, [data], [callback], [type] ) ·url:加载页的地址 ·data(optional):k/v对或序列化的字符串(.serialize()),参数 ·callbakc(optional):数据成功加载后的执行函数 ·type(optional):请求返回的数据格式,串型 三、ashx文件 (1)请求单实体数据 ·Ashx 文件,这里不对返回的数据做显式的序列化。 Customer customer = new Customer { Unid = 1, CustomerName = "宋江", Memo = "天魁星", Other = "黑三郎" }; context.Response.Write(customer); ·ajax post function

Jquery的.post说解(二)

我与影子孤独终老i 提交于 2020-03-01 04:30:56
$.post 调用 webservice ,通过 Response 来返回数据。 (一) Hello ·ws [WebMethod] public void HelloWorld() { HttpResponse Response = HttpContext.Current.Response; Response.ContentEncoding = System.Text.Encoding.Default; Response.Write( " Hello world! " ); } · ajax post function ajaxVoidHello() { $.post( " post_2.asmx/HelloWorld " , function (data) { var jsonString = data.text; $( " #divmessage " ).html(data); }, " json " ); } 客户端得到的数据类型为 string 类型。 (二)得到客户实体 ·ws [WebMethod] public void GetCustomer() { Customer customer = new Customer { Unid = 1 , CustomerName = " 宋江 " , Memo = " 天魁星 " , Other = " 黑三郎 " };

Java 使用 httpClient 发送get、post请求

大憨熊 提交于 2020-02-29 22:11:28
maven 依赖 <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient --> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.6</version> </dependency> get 请求 带参数的 get 请求 public static void getXijingTemplate() throws Exception { String url = "http://www.example.com"; URIBuilder builder = new URIBuilder(url); builder.addParameter("username", "username"); builder.addParameter("password", "123456"); URI uri = builder.build(); HttpGet httpGet = new HttpGet(uri); CloseableHttpResponse response = (CloseableHttpResponse) client

Spring MVC 接收POST表单请求,获取参数总结

你离开我真会死。 提交于 2020-02-29 22:05:12
前段时间遇到一个问题,在spring mvc 服务端接收post请求时,通过html 表单提交的时候,服务端能够接收到参数的值。但是使用httpclient4.3构造post请求,却无法接收到参数的值。 spring 代码: @RequestMapping(value = "login.do", method = RequestMethod.POST) @ResponseBody public String login(String username, String password) throws Exception { return username + ":" + password; } 表单代码: <form action="http://localhost:8080/test/login.do" id="frm" method="post"> name:<input type="text" name="username" id="username"/> </br> psword:<input type="text" name="password" id="password"/> </br> <input id="submit" type="submit" /> </form> httpclient4.3发送post代码: @Test public void