mirror of
https://github.com/KevinWG/OSS.Tools.git
synced 2026-10-28 13:47:33 +08:00
优化设置
This commit is contained in:
+2
-2
@@ -13,8 +13,8 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Debug|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Debug|Any CPU.Build.0 = Release|Any CPU
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5A831C5B-8D82-4A6A-A555-3E04847455D1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F65B8EA8-36E8-42A2-A931-086F6ADA4836}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Debug|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Debug|Any CPU.Build.0 = Release|Any CPU
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7AE49C75-D715-4688-8E11-A8334C461608}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1706C612-6932-4844-9B54-62765D23387F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
||||
@@ -33,6 +33,11 @@ namespace OSS.Http.Mos
|
||||
/// </summary>
|
||||
public Uri Uri{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 如果此值设置,则忽略 Uri 值
|
||||
/// </summary>
|
||||
public string AddressUrl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 请求方式
|
||||
/// </summary>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\OSS.Http.XML</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- A reference to the entire .NET Framework is automatically included -->
|
||||
|
||||
+3
-3
@@ -58,7 +58,7 @@ namespace OSS.Http
|
||||
|
||||
if (request.TimeOutMilSeconds > 0)
|
||||
this.Timeout = TimeSpan.FromMilliseconds(request.TimeOutMilSeconds);
|
||||
|
||||
|
||||
return SendAsync(reqMsg, completionOption, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ namespace OSS.Http
|
||||
{
|
||||
var reqMsg = new HttpRequestMessage();
|
||||
|
||||
reqMsg.RequestUri = request.Uri;
|
||||
reqMsg.RequestUri = string.IsNullOrEmpty(request.AddressUrl) ? request.Uri : new Uri(request.AddressUrl);
|
||||
reqMsg.Method = new HttpMethod(request.HttpMothed.ToString());
|
||||
|
||||
ConfigReqContent(reqMsg,request); // 配置内容
|
||||
ConfigReqContent(reqMsg, request); // 配置内容
|
||||
return reqMsg;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("OSS.Http")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
#if NET45
|
||||
[assembly: AssemblyDescription("通用 Http请求 Framework 版本实现")]
|
||||
#else
|
||||
[assembly: AssemblyDescription("通用 Http请求 Standard 版本实现")]
|
||||
#endif
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyCompany("OSS")]
|
||||
[assembly: AssemblyProduct("OSS.Http")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyCopyright("版权所有(C) OSS开源系列 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -32,5 +35,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.8")]
|
||||
[assembly: AssemblyFileVersion("1.2.8")]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.0")]
|
||||
|
||||
@@ -37,8 +37,10 @@ namespace OSS.Http
|
||||
/// 同步的请求方式
|
||||
/// </summary>
|
||||
/// <param name="request">请求的参数</param>
|
||||
/// <param name="completionOption"></param>
|
||||
/// <returns>自定义的Response结果</returns>
|
||||
public static Task<HttpResponseMessage> RestSend(this OsHttpRequest request,HttpCompletionOption completionOption=HttpCompletionOption.ResponseContentRead)
|
||||
public static Task<HttpResponseMessage> RestSend(this OsHttpRequest request,
|
||||
HttpCompletionOption completionOption=HttpCompletionOption.ResponseContentRead)
|
||||
{
|
||||
if (m_Client==null)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using OSS.Http.Mos;
|
||||
|
||||
namespace OSS.Http.Test
|
||||
@@ -9,6 +10,7 @@ namespace OSS.Http.Test
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
var req = new OsHttpRequest();
|
||||
req.RequestSet = msg => msg.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
|
||||
|
||||
req.Uri = new Uri("http://www.baidu.com");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user