精华内容
下载资源
问答
  • SMS Share URL parameter

    2020-12-25 23:40:49
    The url parameter is missing for SMS share: socialshare-url="" URL page URL Set the url to share <p>Also, if you do not specify the url, you get "undefined" in your sms text.</p><p...
  • Username via URL Parameter

    2020-12-05 05:21:28
    <div><p>Pass username to Hubs room via URL parameter. <p>Please consider allowing the username field to be filled by a URL parameter in the Hubs room link similar to : <p>...
  • <div><p>The url parameter must be coded</p><p>该提问来源于开源项目:fsouza/go-dockerclient</p></div>
  • <div><p>Can we page through using a url parameter like this: http://servername/items/browse?output=atom&per_page=5&page=2 <p>Currently it doesn't work with "page" ...
  • switchTo with URL parameter

    2021-01-07 01:33:01
    <div><p>Hello all, seems that switchTo with URL parameter is not working: Here is an example of step: <pre><code> var data = '<title>plop</title><p>Click the button to open ...
  • <div><p>OpenStreetMap.org already works with url parameter like ?locale= <p>With iD, I have to change <code>detected.locale = (navigator.languages && navigator.languages.length) ? ...
  • <p>Instead of having all the site collections and subsites urls mixed in the <strong>Web Url</strong> property of the React Content Query WebPart, I added another cascading property <strong>Site Url...
  • <div><p>Cloudformation offers a template_url parameter in the CreateStack API, allowing one to specify a URL to a Cloudfomation template in an S3 bucket to be used, rather than passing the contents of...
  • New-PnPSite -Url parameter

    2020-12-26 20:14:43
    <div><p>I cannot get the -url parameter to work: New-PnPSite : A parameter cannot be found that matches parameter name 'Url'. I have version 3.4.1812.2. <p>Using -alias is not good for me, ...
  • <div><p>RegisterWebhookAsync does not url encode the url parameter which breaks registration if you have a ? or & in it for example. I can create a PR to properly encode it but it will double ...
  • <div><p>passing add-in url via dist gulp task using --url parameter examples : <code>gulp dist --url https://myserver.local/</code> <code>gulp dist --url ...
  • URL Parameter Encoding

    2020-12-29 15:45:41
    <div><p>Using marketing URL's, any parameters that are URL encoded get replaced by a "/". Any insight on maintaining url encoding when branch converts this into NSDictionary? <p>Thanks!...
  • <div><p>It would be awesome if SVGO could optimize SVG markup provided by a URL parameter ( <code>https://jakearchibald.github.io/svgomg/?svg=%3Csvg%20xmlns%3D%22...
  • <div><p>How can we send a URL parameter, such as a query string or named router parameter, into the Dash instance? For example, specifying a date range or identifier in the router URL, which could ...
  • <p>I noticed that generally the GQL query seems to be passed as a URL parameter. This PR contains the solution to my problem above.</p><p>该提问来源于开源项目:profusion/sgqlc</p></div>
  • <div><p>Hello, Thank you for this really very beautiful ...It would be possible to add a URL parameter for the player's name? <p>thank-you</p><p>该提问来源于开源项目:webbukkit/dynmap</p></div>
  • URL Parameter Interface

    2020-12-01 11:45:43
    <p>I have a number of RESTful APIs that use URL parameters, even next to body parameters, and it would be great to be able to see and test combinations of URL parameters how one can with body ...
  • I suspect the url parameter has something to do with it but I need it to auto log in on the page. <p>Thanks for your help and support. •os: windows •version: 2.5.6 •query: sitespeed.io -f westwing...
  • <p>New-PnPSite -Url parameter is not working. I updated the module but still does not work. <h3>Expected behavior <p>Code should function per the examples in the documentation here. ...
  • <div><p>Swashbuckle.Swagger.Filters.HandleFromUriParams.ExtractAndAddQueryParams goes into an infinite recursive loop when you define an action with a url parameter that has circular references in it....
  • <div><p>This is the branch holding the work to get the artifact url parameter passed through on the binary deployment rest api.</p><p>该提问来源于开源项目:openshift/origin-server</p></div>
  • <p>Get the url parameter with $this->getProperty/$this->getProperties instead of using the not existing $scriptProperties array. <h3>Why is it needed? <p>During wrapping the code in the class in...
  • <div><p>As discussed on #234 and IRC, this PR adds a <code>collect</code> URL parameter to filter currently enabled collectors. <p>Closes: ...
  • <div><p>In a multisite install, if you call WP-CLI using the --url parameter with an inexistent site url it will die silently. I think we should show a error message to the user. Something like: <pre>...
  • <p>Since the URL, in all the mayor cases, is a customizable parameter in clients, my porposal is to add a significant URL parameter (I'd call it "noicy") that makes Icecast not returning ...
  • - Support a URL parameter to switch themes, e.g. ?preview-theme=edx.org - Write tests to verify that the theme switch is obeyed</p><p>该提问来源于开源项目:edx/ecommerce</p></div>
  • 用retrofit请求网络,遇到这样一个错,Missing either @GET URL or @Url parameter.。 /com.uyac.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.uyac.test, PID: ...

    用retrofit请求网络,遇到这样一个错,Missing either @GET URL or @Url parameter.。

    /com.uyac.test E/AndroidRuntime: FATAL EXCEPTION: main
                                        Process: com.uyac.test, PID: 10349
                                        java.lang.IllegalArgumentException: Missing either @GET URL or @Url parameter.
                                        for method GetWeatherData.getWeather
                                        at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:751)
                                        at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:742)
                                        at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:207)
                                        at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:169)
                                        at retrofit2.Retrofit$1.invoke(Retrofit.java:146)
                                        at java.lang.reflect.Proxy.invoke(Proxy.java:813)
                                        at $Proxy0.getWeather(Unknown Source)
                                        at com.uyac.test.activity.MainActivity.testRetrofitOkhttpGetWeatherData2(MainActivity.java:326)
                                        at com.uyac.test.activity.MainActivity.onClick(MainActivity.java:160)
                                        at android.view.View.performClick(View.java:5637)
                                        at android.view.View$PerformClick.run(View.java:22433)
                                        at android.os.Handler.handleCallback(Handler.java:751)
                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                        at android.os.Looper.loop(Looper.java:179)
                                        at android.app.ActivityThread.main(ActivityThread.java:6152)
                                        at java.lang.reflect.Method.invoke(Native Method)
                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    同样的错还有 Missing either @POST URL or @Url parameter.。


    其实原因错误很简单,就是retrofit所对应的接口写错了。


    @GET("")里面一定要有数据,不能为@GET 或者@GET("")



    那有人就要问了,这个数据是什么呢?我只有baseUrl 和请求所需要的参数


    其实这个数据是_apiname,很多时候可以接在baseUrl后面,但是很多接口里面也当参数,这就导致没有这个数据了。
    解决方法: 没有数据就加 . 或者 /




    这样再次请求就不会报错了。


    需要注意的是,@GET请求需要用@QueryMap

    public interface GetWeatherData2 {
    
        @GET("/")  //没有数据就填 . 或者 /
        public Call<WeatherModel> getWeather(@QueryMap Map<String ,String> map); //@GET请求参数对用 @QueryMap ,POST请求参数对应 @FieldMap
    
    }


    @POST请求需要用@FieldMap ,还有@FormUrlEcoded

    public interface GetWeatherData {
    
        @FormUrlEncoded  //post请求必须加上
        @POST("/")      //没有数据就填 . 或者 /
        public Call<WeatherModel> getWeather(@FieldMap Map<String,String> map); //POST请求参数对应 @FieldMap ,@GET请求参数对用 @QueryMap
    
    }

    下面用post写一个完整请求

    接口代码

    /**
     * Created by Administrator on 2017/3/29.
     *
     * 用来获取天气数据
     */
    
    public interface IGetWeatherData {
    
        @FormUrlEncoded   //post请求必须加上
        @POST(".")       //没有数据就填 . 或者 /
        public Call<WeatherModel> getWeather(@FieldMap Map<String ,String> map); //POST请求参数对应 @FieldMap ,@GET请求参数对用 @QueryMap
    }


    Activity代码

    package com.sqw.testretrofit;
    
    import android.content.Context;
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.view.View;
    import android.view.View.OnClickListener;
    import android.widget.Button;
    import android.widget.TextView;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import okhttp3.OkHttpClient;
    import retrofit2.Call;
    import retrofit2.Callback;
    import retrofit2.Response;
    import retrofit2.Retrofit;
    import retrofit2.converter.gson.GsonConverterFactory;
    
    public class MainActivity extends AppCompatActivity implements OnClickListener{
    
    
        private Context context;
        private Button button;
        private TextView show_data_tv;
        private final String BASE_URL = "http://api.k780.com:88/";
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            context = this;
            viewInit();
        }
    
        private void viewInit() {
    
            button = (Button) findViewById(R.id.button);
            show_data_tv = (TextView) findViewById(R.id.show_data_tv);
            button.setOnClickListener(this);
        }
    
        @Override
        public void onClick(View v) {
    
            switch (v.getId()){
    
                case R.id.button:
    
                    getWeatherData();
    
                    break;
            }
    
        }
    
        /**
         * 获取数据
         */
        private void getWeatherData() {
    
            Map<String, String> map = new HashMap<>();
            map.put("app", "weather.future");
            map.put("weaid", "1");
            map.put("appkey", "10003");
            map.put("sign", "59bc3ef6191eb9f747dd4e83c99f2a4");
            map.put("format", "json");
    
            OkHttpClient.Builder okhttpClientBuilder = new OkHttpClient.Builder();
            Retrofit.Builder retrofitBuilder = new Retrofit.Builder()
                    .baseUrl(BASE_URL)
                    .addConverterFactory(GsonConverterFactory.create());
            Retrofit retrofit = retrofitBuilder.client(okhttpClientBuilder.build()).build();
            IGetWeatherData iGetWeatherData = retrofit.create(IGetWeatherData.class);
            Call<WeatherModel> callWeatherModel = iGetWeatherData.getWeather(map);
            callWeatherModel.enqueue(new Callback<WeatherModel>() {
                @Override
                public void onResponse(Call<WeatherModel> call, Response<WeatherModel> response) {
    
                    ToastUtils.show(context,"请求成功");
                    show_data_tv.setText(" success : "+response.body().getSuccess()+"\n"
                            +" msgid : "+response.body().getMsgid()+"\n"
                            +" msg : "+response.body().getMsg());
    
                }
    
                @Override
                public void onFailure(Call<WeatherModel> call, Throwable t) {
    
                    ToastUtils.show(context,"请求失败");
                }
            });
        }
    }
    


    效果图



    github地址:https://github.com/zhuzhushang/TestRetrofit

    
    
    
    
    
    
    
    
    展开全文
  • <div><p>Proposal: <a href="https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0200-Removing-URL-Param-Max-Length.md">Removing URL Parameter Max Length</a></p> <p>This proposal is ...
  • <p>Is there a way to extend/customize the function that sends this url parameter? Even a capitalized letter would resolve this conflict <code>&Q=search_query</code></p> <p>Thanks.</p><p>该提问...
  • requires the url parameter to be set, but unless I'm missing something, the installer actually runs just fine without the parameter set (once the check for the parameter is removed).</p><p>该提问...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 13,401
精华内容 5,360
关键字:

urlparameter