You can add static headers to retrofit requests using @Headers({}), and specific body fields using @field in the method arguments. But I want to submit constant (non-json) name-value parameters in the body of a post request. The retrofit documentation does not mention it. I shouldn't have to use an interceptor to do this either. Is @FieldMap in the method parameters my only option ? Or is there an annotation that will permit constant Fieldmap similar to @Headers ?
How do you add constant Body fields in retroift POST request?
980 Views Asked by angryITguy At
1
There are 1 best solutions below
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in HTTP-POST
- Ajax.beginForm() cannot get post value
- Python: post files using httplib2
- Spring @RequestPart multipart/mixed Object errors
- Failed to add a node to spatial layer with https post request in Neo4j php
- angularjs post error -405 (Method Not Allowed)
- Ionic app data from html to php server
- How to clear cache only for specific services in android programatically
- error while sendin http PUt to creat a new page in xwiki with REST api
- Sending http post request to php with many data using angular
- Watson Content Analytics: How to make web crawler plug-in to get data, sending POST request?
- Android: how to HTTP post this?
- Http Post with duplicate name values MVC
- how to post objects from angular to a webapi controller
- Where does user registration data get stored with node.js
- MVC - Ajax.BeginForm() generating empty action
Related Questions in RETROFIT2
- Error with retrofit 2 : java.lang.NoSuchMethodError: com.google.gson.Gson.newJsonReader, after updating gradle
- JSON object parsing using retrofit2.0
- Send a Post with url parameter with Retrofit 2
- Android Upload Multiple Files In A Single Request
- Android : Post to server success but okhttp return ECONNRESET (Connection reset by peer)
- How do I inject an abstraction using an IOC container like Dagger 2
- OkHttp - Cannot add custom header
- post parameter that passed in as @Field does not being added into RequestBody in Retrofit2?
- How to handle JSONP response through Retrofit and GsonConverter?
- How do you add constant Body fields in retroift POST request?
- Unable to upload video using Retrofit, possible fix?
- How to create POJO for duplicate property name in JSON for Android Retrofit library
- Dagger 2 multiple Retrofit instances built with different URLs for hitting different APIs using constructor injection
- Retrofit 2: No virtual method newJsonReader(Ljava/io/Reader;) NoSuchMethodException
- Retrofit2 issue with posting array
Related Questions in HTTP-POST-VARS
- How to retrieve HttpPost parameters in c#
- How do you add constant Body fields in retroift POST request?
- Error while installing Poster (Python Module)
- 400 Bad Request. Sending HTTP POST call in Java that was tested in JMeter
- HTTP Post Android webview
- Handling Serialization Exceptions in ServiceStack
- keeping radio button value after post
- How can I pass parameters from the command line to $_POST in a PHP script?
- HTTP POST Requests in Java
- Can JavaScript running in a browser access the values POSTed to it's page?
- Pass txt file lines to html file POST form select options, and retrieve option selected to a php file
- $_POST['input'] into PHP define string
- POST multipart/form-data with Objective-C
- Using scala spark how to print just the response body value returned from a HTTP post call
- PHP HTTP_POST_VARS problem
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use okHttp's RequestBody as your parameter
And then use it like this