ylbtech-Java-Class-C:org.springframework.http.HttpEntity
1.返回顶部
1.1、
import org.springframework.http.HttpEntity;
1.2、

//封装成一个请求对象
HttpEntity entity = new HttpEntity(requestParam, headers);

1.3、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
1、
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
// package org.springframework.http; import org.springframework.lang.Nullable;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils; public class HttpEntity<T> {
public static final HttpEntity<?> EMPTY = new HttpEntity();
private final HttpHeaders headers;
@Nullable
private final T body; protected HttpEntity() {
this((Object)null, (MultiValueMap)null);
} public HttpEntity(T body) {
this(body, (MultiValueMap)null);
} public HttpEntity(MultiValueMap<String, String> headers) {
this((Object)null, headers);
} public HttpEntity(@Nullable T body, @Nullable MultiValueMap<String, String> headers) {
this.body = body;
HttpHeaders tempHeaders = new HttpHeaders();
if (headers != null) {
tempHeaders.putAll(headers);
} this.headers = HttpHeaders.readOnlyHttpHeaders(tempHeaders);
} public HttpHeaders getHeaders() {
return this.headers;
} @Nullable
public T getBody() {
return this.body;
} public boolean hasBody() {
return this.body != null;
} public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
} else if (other != null && other.getClass() == this.getClass()) {
HttpEntity<?> otherEntity = (HttpEntity)other;
return ObjectUtils.nullSafeEquals(this.headers, otherEntity.headers) && ObjectUtils.nullSafeEquals(this.body, otherEntity.body);
} else {
return false;
}
} public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.headers) * 29 + ObjectUtils.nullSafeHashCode(this.body);
} public String toString() {
StringBuilder builder = new StringBuilder("<");
if (this.body != null) {
builder.append(this.body);
builder.append(',');
} builder.append(this.headers);
builder.append('>');
return builder.toString();
}
}
2、
5.返回顶部
 
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-Class-C:org.springframework.http.HttpEntity的更多相关文章

  1. Spring整合Mybatis报 java.lang.ClassNotFoundException:org.springframework.core.metrics.ApplicationStartup,即:spring的版本过高,采用RELEASE稳定版

    1.遇到的问题: 今天在弄spring整合mybatis的时候遇到一个小问题,如图所示: 简单来说:就是我的spring的xml文件没找到,我就奇了怪了,我所有的配置都没问题啊! 我pom.xml配置 ...

  2. Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill

    异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...

  3. 【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface

    后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate ...

  4. SSM报错:No converter found for return value of type: class java.util.ArrayList at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverter

    我使用的是SSM框架,是在编写测试RESTFUL接口的时候出现, @RequestMapping(value = "/selectAll", method = RequestMet ...

  5. Java-Class-C:org.springframework.http.ResponseEntity

    ylbtech-Java-Class-C:org.springframework.http.ResponseEntity 1.返回顶部 1. org.springframework.http Clas ...

  6. Java-Class-C:org.springframework.web.client.RestTemplate

    ylbtech-Java-Class-C:org.springframework.web.client.RestTemplate 1.返回顶部 1. org.springframework.web.c ...

  7. Java Web系列:Spring Boot 基础

    Spring Boot 项目(参考1) 提供了一个类似ASP.NET MVC的默认模板一样的标准样板,直接集成了一系列的组件并使用了默认的配置.使用Spring Boot 不会降低学习成本,甚至增加了 ...

  8. Java Web系列:Spring Boot 基础 (转)

    Spring Boot 项目(参考1) 提供了一个类似ASP.NET MVC的默认模板一样的标准样板,直接集成了一系列的组件并使用了默认的配置.使用Spring Boot 不会降低学习成本,甚至增加了 ...

  9. Spring MVC报异常:org.springframework.web.util.NestedServletException: Request processing failed

    在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发Handl ...

随机推荐

  1. Delphi ComboBox组件 style=csDropDownlist 的赋值方法

    赋值方法: ComboBox1.Items.Add( '文本 '); ComboBox1.ItemIndex := ComboBox1.Items.IndexOf( '文本 '); 清空: Combo ...

  2. SP6779 GSS7 - Can you answer these queries VII

    纯数据结构题,没有思维难度.直接用线段树求最大子段和的方法完成树上路径的合并.注意链上合并顺序要符合序列的前后顺序. #include <cstdio> #include <cstr ...

  3. JAVA学习之跨平台性

    Java语音的特点:跨平台性什么是跨平台性通过Java语音编写的应用程序再不同的系统平台上都可以运行. 原理是什么只要在需要运行Java应用程序的操作系统上.先安装一个Java虚拟机(JVM Java ...

  4. Netty 源码学习——EventLoop

    Netty 源码学习--EventLoop 在前面 Netty 源码学习--客户端流程分析中我们已经知道了一个 EventLoop 大概的流程,这一章我们来详细的看一看. NioEventLoopGr ...

  5. Java文件系统

    Java7 引入了新的输入/输出2(NIO.2)API并提供了一个新的I/O API. 它向Java类库添加了三个包:java.nio.file,java.nio.file.attribute和jav ...

  6. 判断IE版本与各浏览器的语句

    ---恢复内容开始--- 一.IE下判断IE版本的语句 <!--[if lte IE 6]> <![endif]--> IE6及其以下版本可见    <!--[if lt ...

  7. js浮点数的计算总结

    在js浮点值的计算中,很多时候会出现不准确的情况,如下面的情况 console.log(2.2 + 2.1) // 4.300000000000001 console.log(2.2 - 1.9) / ...

  8. 2018湘潭大学程序设计竞赛【E】

    题目链接:https://www.nowcoder.com/acm/contest/105/E 题意:给你美食种类和查询次数,告诉你美味度和价格,给你固定钱数,问你最多能吃到多少美味度的食物.(X真是 ...

  9. json传参报错

    restful接口报错: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('e' (code 101)): w ...

  10. 10种JavaScript特效实例让你的网站更吸引人

    我们有三种主要的方法(从难到易):自己动手写脚本;使用类似于jQuery和mooTools的JavaScript框架(可以让编写代码变得更容易些);使用能工作于现有的JavaScript框架下的提前预 ...