title: Android: Retrofit+RxJava send POST request to local server. I've receive - retrofit.HttpException: HTTP 404 Not Found.
body: <p>I worked on Android project (Android Studio 1.4).
  I want to connect to my Apache server (not REST API) to receive data from him. important NOTICE: I've made the same queries to my server for SWIFT iOS project, I was successfully get POST/GET request, so server is set up and working well. I want to do the same for Android.
  Bellow code:</p>
  
  <p>1) My Service.proto file. I've used protobuf between my client and server.</p>
  
  <pre><code>option java_outer_classname = "Service";
  message BaseModelRequestProtobufDTO 
  {
      required string name = 1;
      required string model = 2;
  }
  message BaseModelResponseProtobufDTO 
  {
      required string response = 1;
  }
  </code></pre>
  
  <p>2) Using the library 'com.squareup.wire:wire-runtime:1.8.0', 
  I've got Java classes - <b>BaseModelRequestProtobufDTO</b> and <b> BaseModelResponseProtobufDTO </b></p>
  
  <p>3) My Retrofit interface:</p>
  
  <pre><code>public interface RetrofitService {
  
     public interface RetrofitService 
  {
      @Headers({"Cookie: bank=*************", "Content-Type: **************"})
      @POST("/baseMethod")
      Observable{BaseModelResponseProtobufDTO} baseRequest(@Body BaseModelRequestProtobufDTO baseModelRequestProtobufDTO);
  }
  </code></pre>
  
  <p>4) my function <b>login</b> take login and password, send to server. I want to receive response from him.</p>
  
  <pre><code>public static void login(String login, String password){
      Log.v("json", "enter in Login = " );
      // Prepare data as JSON object
      Map&lt;String,String&gt; dictionary = new HashMap&lt;&gt;();
      dictionary.put("password", password);
      dictionary.put("login", login);
  
      JSONObject JSONData = new JSONObject(dictionary);
      String JSONModel = JSONData.toString();
  
      Log.v("json", JSONModel);
  
      UFCRequest loginRequest = new  UFCRequest("login", JSONModel);
  
      Log.v("json",loginRequest.baseModel.toString());
      Log.v("json",loginRequest.getBaseModel().toString());
  
      Retrofit retrofit = new Retrofit.Builder()
              .baseUrl("http://77.108.126.41:8080/AAA/endpointshttp/protobuf")
              .addConverterFactory(WireConverterFactory.create())
              .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
              .build();
      RetrofitService retrofitService = retrofit.create(RetrofitService.class);
      retrofitService.baseRequest(loginRequest.getBaseModel())
              .subscribeOn(Schedulers.newThread())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe(new Subscriber{BaseModelResponseProtobufDTO}() {
                  @Override
                  public void onCompleted() {
                      Log.v("json", "onCompleted");
  
                  }
  
                  @Override
                  public void onError(Throwable e) {
                      Log.v("json", "onError " + e);
                  }
  
                  @Override
                  public void onNext(BaseModelResponseProtobufDTO baseModelResponseProtobufDTO) {
                      Log.v("json", baseModelResponseProtobufDTO.response.toString());
  
                      Log.v("json", "onNext");
                  }
              });
  
       }
  </code></pre>
  
  <p>I send protobuf object to server, It's contain two string field <b>name</b> and <b>model</b>. <b>name</b> is simple string name. <b>model</b> is string which was obtained from json object which in turn was emmited from dictionary. Dictionary is login and password.</p>
  
  <p>5) My gradle:</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:23.0.0'
      compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
      compile 'com.squareup.wire:wire-runtime:1.8.0'
      compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
      compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
      compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
      compile 'com.squareup.retrofit:converter-wire:2.0.0-beta2'
      compile 'io.reactivex:rxandroid:1.0.1'
  }
  </code></pre>
  
  <p>6) My result :
  I've receive - <b>retrofit.HttpException: HTTP 404 Not Found.</b></p>
  
  <p>What I'm doing wrong? Please!</p>