I am developing an App , it can work with IP Camera.

The following command format is for IP Camera.
**<http://192.72.1.1/config?set&value=XXXXX>**

And I can type any value and send to the IP Camera.

When the command is **`http://192.72.1.1/config?set&value=111`** , it can sent to the IP Camera. The IP Camera also respond OK.

But When I try to send command that include space or Chinese like the following , it will fail. 

1. **`http://192.72.1.1/config?set&value=111 222`**
2. **`http://192.72.1.1/config?set&value=二三四`**

The code is like the following:

```
public static String sendRequest(URL url) {

        try {
            //Show the command
            Log.i("CameraCommand", url.toString()) ;

            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection() ;

            urlConnection.setUseCaches(false) ;
            urlConnection.setDoInput(true) ;

            urlConnection.setConnectTimeout(3000) ;
            urlConnection.setReadTimeout(8000) ;

            urlConnection.connect() ;

            int responseCode = urlConnection.getResponseCode() ;

            Log.i("CameraControlFragment", "responseCode = " + urlConnection.getResponseCode()) ;

            if (responseCode != HttpURLConnection.HTTP_OK) {

                return null ;
            }

            InputStream inputStream = urlConnection.getInputStream() ;

            Writer writer = new StringWriter() ;

            char[] buffer = new char[1024] ;
            try {
                Reader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")) ;
                int n ;
                while ((n = reader.read(buffer)) != -1) {
                    writer.write(buffer, 0, n) ;
                }
            } finally {
                inputStream.close() ;
            }
            String string = writer.toString() ;
            Log.i("CameraControlFragment", "string = " + string) ;

            return string ;

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace() ;
        }

        return null ;
    }

```

When the command include space or Chinese , it show the following log:

```
08-17 18:13:18.105: W/System.err(22120): java.net.ProtocolException: Unexpected status line: HTTP/0.0 400 Bad Request
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.StatusLine.<init>(StatusLine.java:38)
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:180)
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:101)
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:628)
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
08-17 18:13:18.105: W/System.err(22120):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
08-17 18:13:18.106: W/System.err(22120):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
08-17 18:13:18.106: W/System.err(22120):    at tw.com.WIFI_CAM_R660.IPCamViewer.CameraCommand.sendRequest(CameraCommand.java:734)
08-17 18:13:18.106: W/System.err(22120):    at tw.com.WIFI_CAM_R660.IPCamViewer.CameraCommand$SendRequest.doInBackground(CameraCommand.java:773)
08-17 18:13:18.106: W/System.err(22120):    at tw.com.WIFI_CAM_R660.IPCamViewer.CameraCommand$SendRequest.doInBackground(CameraCommand.java:1)
08-17 18:13:18.106: W/System.err(22120):    at android.os.AsyncTask$2.call(AsyncTask.java:292)
08-17 18:13:18.106: W/System.err(22120):    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-17 18:13:18.106: W/System.err(22120):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
08-17 18:13:18.106: W/System.err(22120):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
08-17 18:13:18.106: W/System.err(22120):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
08-17 18:13:18.106: W/System.err(22120):    at java.lang.Thread.run(Thread.java:818)

```

The **`CameraCommand.java:734`** is int `responseCode = urlConnection.getResponseCode()` ;

Does somebody know how to send command that include space and Chinese ?

Thanks in advance.