Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8153011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:52:50+00:00 2026-06-06T15:52:50+00:00

I am receiving a NullPointerException when trying to send a POST request to a

  • 0

I am receiving a NullPointerException when trying to send a POST request to a server through HTTPS. This is not a self-signed certificate (issued by CheapSSLs).

This is the error I am receiving:

06-21 18:52:37.757: E/AndroidRuntime(17985): FATAL EXCEPTION: AsyncTask #1
06-21 18:52:37.757: E/AndroidRuntime(17985): java.lang.RuntimeException: An error occured while executing doInBackground()
06-21 18:52:37.757: E/AndroidRuntime(17985):    at android.os.AsyncTask$3.done(AsyncTask.java:200)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at java.lang.Thread.run(Thread.java:1019)
06-21 18:52:37.757: E/AndroidRuntime(17985): Caused by: java.lang.NullPointerException
06-21 18:52:37.757: E/AndroidRuntime(17985):    at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:433)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:378)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:205)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:614)
06-21 18:52:37.757: E/AndroidRuntime(17985):    at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:268)

My code is as follows:

URL url = new URL(mUrl);
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("192.168.1.134", 8888));
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection(proxy);

urlConnection.setRequestMethod("POST");
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);

MultipartBodyBuilder builder = new MultipartBodyBuilder();
builder.build(params);

urlConnection.setRequestProperty("Content-Type",  "multipart/form-data; boundary=" + builder.mBoundary);
urlConnection.setFixedLengthStreamingMode(builder.getContentLength());

DataOutputStream out = new DataOutputStream(new BufferedOutputStream(urlConnection.getOutputStream()));

The code crashes on getOutputStream.

Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:52:53+00:00Added an answer on June 6, 2026 at 3:52 pm

    Try it without including the proxy object in the mix… HttpsConnection should be enough to get the job done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im receiving error C2082: redefinition of formal parameter 'rval' in this code while trying
Im receiving this error when trying to compile my code. $ g++ -o BangBangControlTest
Im receiving this error The name 'Textbox1' does not exist in the current context
I'm receiving this HTML document via AJAX: <form enctype=multipart/form-data method=POST action=admin.php?do=media&action=file-upload> <div id=uploadForm> <div
I'm receiving .NET's DateTime object as json string through my asmx webservice and trying
I have been receiving errors when trying to save and run this Python 3.1
I'm receiving 500 - Internal server error. on the domain of my WordPress site.
I'm receiving a string a=100,b=20,c=20; for instance I know exploding this into an array
I keep on receiving this error: Showing app/views/posts/index.html.haml where line #115 raised: app/views/posts/index.html.haml:115: syntax
Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.