httpconnection

Display static Google Map image in BlackBerry 5.0

扶醉桌前 提交于 2019-12-12 16:07:28
问题 I'm having a really interesting problem to solve: I'm getting a static google map image, with an URL like this. I've tried several methods to get this information: Fetching the "remote resource" as a ByteArrayOutputStream, storing the Image in the SD of the Simulator, an so on... but every freaking time I get an IlegalArgumentException . I always get a 200 http response, and the correct MIME type ("image/png"), but either way: fetching the image and converting it to a Bitmap, or storing the

Azure VM outbound HTTP is unreliable

时光怂恿深爱的人放手 提交于 2019-12-12 04:17:25
问题 I have setup and Azure VM and installed a monitoring service that reaches out to various endpoints to verify a 200 response. The service is set to cycle through about 8 URL endpoints every 5 minutes or so. We have run this service from multiple other servers outside of Azure, including virtual machines that are cheap, low end offerings. While this machine is running on the lowest A0, it isn't doing anything else other than to run this service and call out to the various endpoints. We are

blackberry HttpConnection.GET

亡梦爱人 提交于 2019-12-12 01:48:45
问题 URL: http://monSite/GET.asp we must authenticate before getting the result. I want to send the login and password with HttpConn.setRequestMethod (HttpConnection.POST) and retrieve the XML file with HttpConn.setRequestMethod (HttpConnection.GET) with the same HTTP Client. conn = (HttpConnection) new ConnectionFactory().getConnection(_url).getConnection(); URLEncodedPostData postData = null; postData = new URLEncodedPostData("UTF-8", false); postData.append("userName",_username); postData

getErrorStream: stream closed, getInputStream: works

流过昼夜 提交于 2019-12-11 18:08:44
问题 I have a weird issue with my code: URL url = new URL(searchUrlPOST.replace("%accessToken", accessToken)); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(5000); conn.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod("POST"); OutputStream os = conn.getOutputStream(); os.write(json.getBytes("UTF-8")); os.close(); // read the response InputStream in = new

None of code can establish http connection over BIS

吃可爱长大的小学妹 提交于 2019-12-11 16:22:45
问题 I am new in developing Blackberry Application. In these three days, I already searched and learned in both forum and tutorial from the RIM itself. But none of them can solve my problem. >.< So. I already tried some different methods to establish http connection over BIS in 4.6. These are the following codes: 1. HttpConnection httpConnection; String url = "myURL;deviceside=true"; try{ httpConnection = (HttpConnection) Connector.open(url); Dialog.inform(">.<"); } catch(Exception e) { Dialog

Upload multiform data

倾然丶 夕夏残阳落幕 提交于 2019-12-11 13:38:02
问题 Helo I tryed to upload some data to my webserver. whit curl works fine curl -s -uedoweb-admin:admin -F"data=@/home/raul/test/t1/6376990.pdf;type=application/pdf" -XPUT api.localhost/resource/frl:6376979/data and here the trace http://pastebin.com/jJmungAy here the new methode. URL myurl; HttpURLConnection conn; String port = "9000"; String user = "edoweb-admin"; String password = "admin"; String encoding = Base64.encodeBase64String((user + ":" + password).getBytes()); String boundary = "==" +

Android HttpUrlConnection Url doesn't work on emulator

本秂侑毒 提交于 2019-12-11 12:36:10
问题 I am trying to get json object as string from this url http://digitalcollections.tcd.ie/home/getMeta.php?pid=MS4418_021. It doesn't work I get an error after downloadUrl function. java.io.IOException: unexpected end of stream on Connection{digitalcollections.tcd.ie:80, proxy=DIRECT@ hostAddress=134.226.115.12 cipherSuite=none protocol=http/1.1} (recycle count=0) Although it does work for this androidhive url http://api.androidhive.info/volley/person_object.json. I am new to httpconnection

ServicePoint,HttpConnectionHttp 1.1,httppipelining, Responons,stream.close internals?

痴心易碎 提交于 2019-12-11 08:35:46
问题 In .net framework 3.5 , http 1.1 i.e persistent connections is used and pipelining is enabled bydefault. Could you please let me know it is neccessary to close stream or connection by calling httpresponse.close or stream.close method to release a connection for another http request to the same internet resourece ? My understanding is even if httpresponse.close or stream.close is not called then too httpconnection i.e. servicepoint should be able to server another concurrent request. Please

program crashing at .connect() on Android, not connecting

[亡魂溺海] 提交于 2019-12-10 17:36:48
问题 I been trying to figure this out for hours now. I've searched for answers, but I can't find an answer. I have never bothered to ask before and this is the first time I'm asking a question. Basically what I am doing is breaking up my coding for organization purposes. The following snippet works just fine, but when I take it and place it into another class the urlConnect(); connects just fine. I've marked it below. public String downloadUrl(String strUrl) throws IOException{ String data = "";

Communication between UI thread and other threads using handler

别说谁变了你拦得住时间么 提交于 2019-12-10 14:56:42
问题 How to do inter thread communication between UI thread and background thread? I want use common handler concept here to update my UI. I have the concept as below new Thread(new Runnable() { public void run() { while (mProgressStatus < 100) { mProgressStatus = doWork(); // Update the progress bar mHandler.post(new Runnable() { public void run() { mProgress.setProgress(mProgressStatus); } }); } } }).start(); I want to use two classes, one class contains main thread, another class contains