Merge branch 'master' of http://dd-vmp07-com04:3000/AppStd/Monorepo
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Public Class QueryData
|
||||
Public Query As String
|
||||
Public OperationName As String
|
||||
Public Variables As New Object
|
||||
Public query As String
|
||||
Public operationName As String
|
||||
Public variables As New Object
|
||||
End Class
|
||||
|
||||
@@ -13,9 +13,10 @@ Public Class GraphQLInterface
|
||||
Private _userPassword As String
|
||||
Private _certificate As X509Certificate
|
||||
Private _cookieJar As CookieContainer
|
||||
|
||||
Private _Encoding As New UTF8Encoding
|
||||
|
||||
Public Property Proxy As WebProxy
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, BaseUrl As String, Email As String, Password As String, CertificateFile As String, CertificatePassword As String)
|
||||
Try
|
||||
_logConfig = LogConfig
|
||||
@@ -71,11 +72,12 @@ Public Class GraphQLInterface
|
||||
Public Function GetData(Query As String, OperationName As String) As HttpWebResponse
|
||||
Try
|
||||
Dim oQueryData As New QueryData() With {
|
||||
.OperationName = OperationName,
|
||||
.Query = Query,
|
||||
.Variables = New Object
|
||||
}
|
||||
Dim oBytes = ToBytes(JsonConvert.SerializeObject(oQueryData))
|
||||
.operationName = OperationName,
|
||||
.query = Query,
|
||||
.variables = New Object
|
||||
}
|
||||
Dim oJson = JsonConvert.SerializeObject(oQueryData)
|
||||
Dim oBytes = ToBytes(oJson)
|
||||
Dim oRequest = GetRequest("/graphql", oBytes)
|
||||
|
||||
Using stream = oRequest.GetRequestStream()
|
||||
@@ -91,6 +93,9 @@ Public Class GraphQLInterface
|
||||
|
||||
Private Function GetRequest(Url As String, PostData As Byte()) As HttpWebRequest
|
||||
Try
|
||||
ServicePointManager.Expect100Continue = True
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
|
||||
|
||||
Dim oRequest As HttpWebRequest = WebRequest.Create($"{_baseUrl}{Url}")
|
||||
oRequest.Method = "POST"
|
||||
oRequest.ContentType = "application/json"
|
||||
@@ -98,6 +103,10 @@ Public Class GraphQLInterface
|
||||
oRequest.ClientCertificates.Add(_certificate)
|
||||
oRequest.CookieContainer = GetCookies()
|
||||
|
||||
If Proxy IsNot Nothing Then
|
||||
oRequest.Proxy = Proxy
|
||||
End If
|
||||
|
||||
Return oRequest
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
@@ -107,7 +116,7 @@ Public Class GraphQLInterface
|
||||
|
||||
Private Function GetCookies() As CookieContainer
|
||||
If _cookieJar Is Nothing Then
|
||||
_cookieJar = New CookieContainer()
|
||||
_cookieJar = New CookieContainer(300, 20, 8192)
|
||||
End If
|
||||
|
||||
Return _cookieJar
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.1.0.0")>
|
||||
<Assembly: AssemblyVersion("1.1.0.1")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
|
||||
@@ -117,7 +117,7 @@ Public Class PDFAttachments
|
||||
Continue For
|
||||
End If
|
||||
Else
|
||||
Logger.Warn("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
|
||||
Logger.Debug("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
|
||||
Continue For
|
||||
End If
|
||||
Else
|
||||
|
||||
Reference in New Issue
Block a user