草庐IT

HttpClient-Xamarin

全部标签

ios - xamarin iOS : Location Request how to find out when user clicks “Allow” or “Don' t allow” is clicked

应用加载时,系统会提示用户启用位置权限。只有当用户在该弹出窗口中点击“允许”或“不允许”时,我才想移动到下一页。我看到了一些问题,例如this但他们没有帮助。我的代码:varlocationManager=newCLLocationManager();locationManager.AuthorizationChanged+=(objectsender,CLAuthorizationChangedEventArgse)=>{if(ee.Status==CLAuthorizationStatus.AuthorizedAlways||ee.Status==CLAuthorizationSt

ios - 如何将基于 swift 的 .Framework 或 Pod 绑定(bind)到 Xamarin?

我正在尝试绑定(bind)此FoldingCell到Xamarin项目,但看不到提到的*.a文件inthesedirections.sudogeminstallcocoapodssharpiepodinitiosFoldingCellsharpiepodbind如页面底部所示,我应该followthesedirectionstomakeabindingproject,但说明需要*.a文件。由于我拥有FoldingCell框架的源代码,我知道我很可能可以进行所需的更改。(免责声明,我所有的iOS工作都是使用Xamarin,而不是XCode) 最佳答案

swift - 在 Xamarin 中使用 Swift 库

文章https://developer.xamarin.com/guides/cross-platform/macios/binding/提到如何在Xamarin中使用使用Objective-C编写的native库。是否有任何文档可用于对用Swift编写的native框架执行相同的操作?https://developer.xamarin.com/guides/ios/advanced_topics/embedded_frameworks/谈论使用嵌入式框架,但它没有说任何关于swift的事情。同样的事情有效吗? 最佳答案 官方不支持

java - 忽略 Apache HTTPClient 4.5 中的自签名证书

我正在尝试使用ApacheHTTPClient4.5版接受所有证书,和/或接受自签名证书(教程链接here)我一直在通过SO上的一堆帖子来解决这个问题。到目前为止,他们都没有工作。我不断收到此错误:尝试执行请求时出错。javax.net.ssl.SSLHandshakeException:握手期间远程主机关闭连接Apache文档:Apachev4.5tutorialSSL/TLScustomizationApachehasaguide适用于版本3,但不适用于版本4。相关StackOverflow问题-以下是我尝试过的解决方案的一些链接:IgnoringSSLcertificateinA

java - 无法实例化 HttpClient 类型

我已将.jars添加到我的库中,我还可以实例化JAR中的其他类。是什么赋予了?我尝试清理项目等。这是一个编译时错误。Eclipse不允许我实例化它。我正在导入正确的库,而不是sun版本,并使用由其tutorial指定的默认构造函数HttpClientclient=newHttpClient();(Eclipse、mac、ApacheHTTP、从here下载的“HttpClient4.0.1(GA)”) 最佳答案 HttpClient是4.x中的一个接口(interface),例如使用DefaultHttpClientHttpClie

java - C# Xamarin Java.Interop 错误?

您好,自上次Xamarin更新以来,我们得到了这个错误。CS0012Thetype'IJavaPeerable'isdefinedinanassemblythatisnotreferenced.Youmustaddareferencetoassembly'Java.Interop,Version=0.1.0.0,Culture=neutral,PublicKeyToken=84e04ff9cfb79065'.ImageLibraryC:\Users\rutge\Source\Repos\GarderobeApp\ImageSwiper\ImageSwiper.cs33Active有人知

java - 在 Java httpclient 中设置用户代理并允许重定向到 true

我试图在Java中的HttpClientapache对象中设置我的用户代理字符串,但我不知道如何做。请帮忙!此外,我正在尝试启用重定向到true,但也无法在HttpClient对象中找到此选项。谢谢安迪 最佳答案 对于HttpClient4.0,以下对我有用:importorg.apache.http.params.HttpProtocolParams;HttpClienthttpclient=newHttpClient();HttpProtocolParams.setUserAgent(httpclient.getParams()

java - HttpClient.execute 抛出 OutOfMemoryError

我有一个发布JSONObject的Android应用程序作为实体使用ByteArrayEntity目的。这是它的样子:post.setEntity(newByteArrayEntity(entity.getBytes("UTF-8")));result=client.execute(post,handler);实体是一个String.处理程序是ResponseHandler客户是HttpClient.这在模拟器和某些设备上运行良好。但是,有时我在执行x10i时遇到OutOfMemoryError(也称为XPERIA)。这是堆栈:java.lang.OutOfMemoryErrorato

java - Apache HttpClient : setConnectTimeout() vs. setConnectionTimeToLive() 与 setSocketTimeout()

谁能解释一下这两者之间的区别:client=HttpClientBuilder.create().setConnectionTimeToLive(1,TimeUnit.MINUTES).build();和RequestConfigrequestConfig=RequestConfig.custom().setConnectTimeout(30*1000).build();client=HttpClientBuilder.create().setDefaultRequestConfig(requestConfig).build();使用setSocketTimeout()是否更好?

java - 我如何使用 Spnego/Kerberos 和 Apache 的 HttpClient 进行身份验证?

如何正确设置与HttpClient的连接,该连接使用登录用户的ActiveDirectory凭据对网站进行身份验证并需要Kerberos/Spnego身份验证? 最佳答案 这是一个例子:publicclassHttpSpnegoConnection{/***UsesHttpClient4.3.4andCommonsIO2.4*/publicstaticvoidmain(String[]args)throwsClientProtocolException,IOException{Stringdomain="yourdomain.com