title: Json wont arrive
body: <p>My friend coded an API and i have to code the frontend for it on Android. But the json won't arrive. I know that my code works because i testet it on 3 diffrent testers and his api also works. He also testet it a few times. But if i send something to no data will arive. The request arrives but not the data. The response also works but it always says that the Strings are null. I host the api on my own computer. Could it be, that the Virtual Device can't send anything to the pc it is hosted on? I hope someone can help me.</p>
  <p>here is my code:</p>
  <p>MainActivity</p>
  <pre><code> public void post(String pswd, String name){
      TextView textViewResult = findViewById(R.id.responses);
      Post post = new Post(name,pswd);
  
      HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
      loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
  
      OkHttpClient okHttpClient = new OkHttpClient.Builder()
              .addInterceptor(loggingInterceptor)
              .build();
  
      Retrofit retrofit = new Retrofit.Builder()
              .baseUrl(&quot;http://localhost:5000&quot;)
              .addConverterFactory(GsonConverterFactory.create())
              .client(okHttpClient)
              .build();
  
      API api = retrofit.create(API.class);
  
      Call&lt;Post&gt; call = api.createPost(post);
      call.enqueue(new Callback&lt;Post&gt;() {
          @Override
          public void onResponse(Call&lt;Post&gt; call, Response&lt;Post&gt; response) {
              if(!response.isSuccessful()){
                  textViewResult.setText(&quot;Code: &quot; + response.code());
                  return;
              }
              Post postResponse = response.body();
              String content = &quot;&quot;;
              content += &quot;Code: &quot; + response.code() + &quot;\n&quot;;
              content += &quot;token: &quot; + postResponse.getToken() + &quot;\n&quot;;
              content+= &quot;msg: &quot; +postResponse.getMsg();
  
                  Endcontent = content;
          }
  
          @Override
          public void onFailure(Call&lt;Post&gt; call, Throwable t) {
              Endcontent = t.getMessage();
  
          }
  
      });
  
  }
  </code></pre>
  <p>Api:</p>
  <pre><code>import java.util.List;
  
  import retrofit2.Call;
  import retrofit2.http.Body;
  import retrofit2.http.FormUrlEncoded;
  import retrofit2.http.GET;
  import retrofit2.http.POST;
  
  public interface API {
      @GET(&quot;posts&quot;)
      Call&lt;List&lt;Get&gt;&gt; getPosts();
  
  
      @POST(&quot;api/gen_token&quot;)
      Call&lt;Post&gt; createPost(@Body Post post);
  
  
  }
  </code></pre>
  <p>and the Post:</p>
  <pre><code>public class Post {
      private String name;
      private String pswd;
      private String token;
      private String msg;
  
      public Post(String name, String pswd) {
          this.name = name;
          this.pswd = pswd;
      }
  
      public String getPswd() {
          return pswd;
      }
      public String getMsg(){
          return msg;
      }
  
      public String getName() {
          return name;
      }
  
      public String getToken() {
          return token;
      }
  }
  </code></pre>