gpt4 book ai didi

java - "How to fix this post HTTP request using Android Studio?"

转载 作者:行者123 更新时间:2023-12-02 01:15:01 26 4
gpt4 key购买 nike

我正在尝试将 HTTP 请求发布到我的 Web 应用程序。但没有采取任何行动。我哪里错了?

class AsyncT extends AsyncTask<Void,Void,Void> {
@Override
protected Void doInBackground(Void... params){
try{
String url1 = "http://172.26.1.1/data/omnidrive";
URL url = new URL(url1);
HttpURLConnection httpURLConnection =
(HttpURLConnection)url.openConnection();
httpURLConnection.setDoOutput(true);
httpURLConnection.setRequestMethod("POST");
httpURLConnection.connect();
String data = "[0.10,0.00,0.00]";

DataOutputStream wr = new
DataOutputStream(httpURLConnection.getOutputStream());
wr.writeBytes(data);
wr.flush();
wr.close();
} catch (MalformedURLException e){
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
}
return null;
}
}

我预计数据会在网络应用程序中更新。

这是我点击按钮后显示的内容

错误

W/Settings: Setting device_provisioned has moved from android.provider.Settings.Secure to android.provider.Settings.Global. V/HiTouch_HiTouchSensor: User setup is finished. D/NetworkSecurityConfig: No Network Security Config specified, using platform default I/ViewRootImpl: jank_removeInvalidNode all the node in jank list is out of time

最佳答案

  • 尝试一下这个可能会对您有所帮助。

  • 首先在 res 文件夹下创建一个名为 xml 的文件夹,然后在该文件夹中创建一个名为 network_security_config 的 xml 文件。

  • 然后在该 xml 文件中添加以下代码行。

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
    <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">your url</domain>
    </domain-config>
    </network-security-config>
  • 然后是 list 文件中应用程序标记的下面一行。

    android:networkSecurityConfig="@xml/network_security_config"

关于java - "How to fix this post HTTP request using Android Studio?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58813684/

26 4 0
文章推荐: java - 在 Spring 的多个 beans 配置文件上使用 '

我不明白为什么我的固定背景开始出现,因为它有时没有被固定。 这是一个非常特殊的案例,我知道如何解决它。 您可以删除: .row2 position:relative 或 row1 div -webki

  • CSS - 4列(fixed fluid fluid fixed)

    我看过三列的例子(fixed fluid fixed)。但是,我需要一个四列解决方案的示例。 两个外部列是固定的。两个内柱是流动的。 固定 |流体 |流体 |固定 最佳答案 您可以使用 calc .

  • haskell - Haskell 中的类型 `Fix` 和函数 `fix` 如何相同?

    我试图说服自己输入 Fix和功能 fix是一回事。 但我找不到他们的定义之间的相关性 -- definition of fix fix :: (p -> p) -> p fix f = let {x

  • Delphi和离散信号: Getting a fixed volume signal with fixed silence

    这是我已经在这里提出的另一个问题的后续How can I play a single tone or custom wave with Delphi? 长话短说,我使用 MMSystem 的 wave

  • html - IE7 position fixed issue which Doctype doesn't fix

    刚刚完成一个站点并遇到位置问题:已在 IE7 上修复。我用谷歌搜索并尝试了不同的 Doctypes,但固定区域在 IE7 上仍然不在位。 我没有 IE7,但一位客户员工有,我可以使用在线 IE 渲染器

  • html - CSS 位置 : fixed and background-attachment: fixed

    我有我的 设置为 background-attachment: fixed但这留下了我的标签正常滚动。如果我设置 position: fixed到我的标签,它们会跳转到页面顶部。有什么办法可以做与 b

  • jquery - CSS::Fixed header 没有设置 position:fixed

    我有一个包含标题页(导航栏)的 php 页面。我想将导航栏显示为固定标题,但每当将其位置更改为固定时,它都会删除滚动条(水平和垂直)并且我无法滚动页面。如果我想保持我的标题固定并且我不想固定位置。我怎

  • java - 如何测试我的 FIX 客户端?那里有我可以使用的假 FIX 交易所吗?

    已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是无关紧要的,

  • header - 如何使用数据位置为 'fix' 的 jquery mobile ="fixed"页眉页脚位置

    我正在使用 jquery mobile,对于页眉/页脚,我使用的是 data-position="fixed"。 但是,当我们滚动页面时......页眉页脚消失并在滚动停止时重新出现.. 有没有一种方

  • java - FIX 协议(protocol) - quickfixJ 和 FIX 的版本

    我正在尝试连接到使用 FIX 5.0 的代理 我想利用 quickfixj以方便和快速地实现。 这行吗?我假设 5.0 extends(可以这么说)以前版本的功能,但我不想走得太远,结果导致更多问题,

  • javascript - 隐藏/显示位置 :fixed container under non-fixed containers

    如何放置 position:fixed内容在页面背景中的容器,而其他内容在其上滚动,同时仍然保持点击背景元素的能力? 效果类似于前景内容在固定背景上滚动的视差滚动情况,但我希望能够将 HTML 放在背

  • html - Z-index in position fixed under position fixed 元素

    我尝试将 z-index 设置为 body 下的某些位置为 fixed 的元素 示例如下: HTML menu content ....

  • jquery - 位置 :fixed element inside fixed size div

    我花了几个小时寻找这个问题的答案,但其他人提供解决方案的场景似乎比我的稍微简单一些。 有没有办法在固定大小的 div 中放置一个 position:fixed 元素,而该元素不会溢出 div? 换句话

  • css - Chrome + 位置 :fixed + background-attachement:fixed 的奇怪行为

    此问题已在 SO 和其他地方多次报告,但我找不到任何有效的解决方案。 如果您有固定位置的 div 和固定附加的背景,在某些特定情况下,在 Google Chrome 上呈现会出现错误(在 Firefo

  • css - html 文档中的 fixed-fluid-fixed header 出现问题

    我想在我网站的页面顶部创建一个标题栏,但我在布局方面遇到了问题。以下是我想要的结果: goal http://ambiguities.ca/images/goal.png 这是 html:

  • Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com