-1
。我想送頭和參數與HTTPS請求,我從日誌中的以下網址:改造URL與標題,我有一些麻煩與改造2庫PARAMS
https://api.trakt.tv/movies/popular(page=「1」)限值爲10 &延長=飽滿,圖像
我得到了404狀態碼?上述網址是正確的?
字符串ENDPOINT = 「https://api.trakt.tv/」;
@GET("movies/popular(page='{page}')?limit=10&extended=full,images")
public Observable<PopularMoviesResponse> getPopularMovies(@Header("trakt-api-version") String trakt_api_version,
@Header("trakt-api-key") String trakt_api_key,
@Path("page") String page);
/********
* Helper class that sets up a new services
*******/
class Creator {
public static MovieService newSurveiesService() {
Gson gson = new GsonBuilder()
.setDateFormat("dd/MM/yyyy hh:mm:ss")
.create();
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(MovieService.ENDPOINT)
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
.build();
return retrofit.create(MovieService.class);
}
}
你嘗試從瀏覽器去那裏? – CaseyB
我正在使用PostMan,因爲我正在發送標題數據。我剛剛在你的評論後對它進行了測試,但沒有奏效。有什麼建議麼? – Androider
你想試試嗎?它在Postman中工作嗎? – CaseyB