草庐IT

post_values

全部标签

Android - 检查请求是 GET 还是 POST

我需要在我的Android应用程序的shouldInterceptRequest中检查请求是POST还是GET。见下面的代码:publicclassCustomWebViewClientextendsWebViewClient{...@OverridepublicWebResourceResponseshouldInterceptRequest(WebViewview,Stringurl){if("requestisPOST")Log.d("CustomWebViewClient","requestisaPOST");elseif("requestisGET")Log.d("Custo

java - 使用 values.xml 设置 Android Activity 屏幕方向

我正在尝试使用res/values中的XML文件中的值设置Activity屏幕方向。我想这样做是因为,或多或少,我需要为平板电脑(横向)和智能手机(纵向)提供相同的Activity。先试试list:配置文件:portrait但是使用这个设置应用程序不会出现在设备上并且它会返回这个错误:java.lang.NumberFormatException:Invalidint:"portrait"第二OK,所以我干脆改成了这样list:配置文件:1我使用1因为ActivityInfo.SCREEN_ORIENTATION_PORTRAIT==1。但这也不起作用。看来我可以修改一些值,例如应用程

android - 使用 Volley 发送带有 JSONArray 的 POST 请求

我想在Android中发送一个简单的POST请求,正文如下:[{"value":1}]我尝试在Android中使用Volley库,这是我的代码://thejsonArraythatIwanttoPOSTStringjson="[{\"value\":1}]";JSONArrayjsonBody=null;try{jsonBody=newJSONArray(json);}catch(JSONExceptione){e.printStackTrace();}finalJSONArrayfinalJsonBody=jsonBody;//startingtherequestfinalReque

php - 使用来自 Android 应用程序的文件和文本发出 POST 请求

我在从我的Android应用程序向我的Web服务(GoogleCloud和PHP)发出正确的POST请求时遇到了一些问题。当我尝试从Android发送图像时,它返回“200OK”响应,但该图像并未保存在GoogleCloudStorage的存储桶中。我知道问题出在我在Android应用程序中的方法发出的POST请求,因为我已经使用Postman进行了测试,并且没有遇到任何问题。所以我的应用程序中的以下代码有问题:publicvoiduploadFile(StringuploadUrl,Stringfilename,StringnewFileName)throwsIOException{

android - 在 android 上通过 POST 发送二进制数据

Android支持有限版本的apache的http客户端(v4)。通常如果我想通过POST使用contenttype=application/octet-stream发送二进制数据,我执行以下操作:HttpClientclient=getHttpClient();HttpPostmethod=newHttpPost("http://192.168.0.1:8080/xxx");System.err.println("sendtoserver"+s);if(compression){byte[]compressed=compress(s);RequestEntityentity=newB

java - 错误 : No resource found that matches the given name (at 'title' with value '@string/menu_settings' )

我正在做“hellotoandroid”一书中的“数独”练习。我看到有人和我有同样的问题,但我无法解决。我已经删除了这个项目三次并从头开始重新创建,但我一直在下面收到相同的错误消息,即使我正在从书中复制/粘贴也是如此。W/ResourceType(8592):BadXMLblock:headersize29806ortotalsize538970658islargerthandatasize0C:\java\Sudoku\res\layout\activity_main.xml:6:error:Error:Noresourcefoundthatmatchesthegivenname(a

android - 如何将 http post 从 android 发送到 google app engine 服务器?

我正在尝试从我的android向我在GAE上的服务器发出httppost请求。在android端,帖子似乎运行良好,但在服务器端,doPost(...)永远不会被调用。谁能告诉我为什么?这是我的相关安卓代码:protectedIntegerdoInBackground(View...arg0){try{HttpClienthttpClient=newDefaultHttpClient();//HttpPosthttpPost=newHttpPost("http://elf-security.appspot.com");HttpPosthttpPost=newHttpPost("http

android - 将音频流式传输到 Android 中的 http-post

我正在努力从Android设备录制语音,将数据编码为某种音频编码(M4A、FLAC、Ogg)将其流式上传到我的服务器(分块的http帖子)-在录制过程中。有什么想法可以实现这些吗?我尝试使用Android的MediaRecorder(它记录音频、编码并保存到文件)并使用Android的HttpClient和InputStreamEntity,它允许从输入上传数据溪流。我使用了https://github.com/Teaonly/android-eye/blob/master/src/teaonly/droideye/StreamingLoop.java中的“StreamingLoop”

关于Springboot中 Invalid value type for attribute ‘factoryBeanObjectType‘报错解决

具体报错如下 2023-11-30T09:56:47.737+08:00INFO8075---[main]com.hj.SpringBootTestApplication:StartingSpringBootTestApplicationusingJava21withPID8075(/home/he/IdeaProjects/springBootTest/target/classesstartedbyhein/home/he/IdeaProjects/springBootTest)2023-11-30T09:56:47.739+08:00INFO8075---[main]com.hj.Spri

android - 领英 API : No value for accessTokenValue and "access toke is not set" error

publicvoidsignInWithLinkedIn(Viewview){//Firstcheckifuserisalreadyauthenticatedornotandsessionisvalidornotif(!LISessionManager.getInstance(this).getSession().isValid()){//ifnotvalidthenstartauthenticationLISessionManager.getInstance(getApplicationContext()).init(LinkedInActivity.this,buildScope(