Reputation: 111
I want to send post request with retrofit with additional things like oAuth 1.0, Consumer Key and Consumer secret Image for explain briefly
and I want to send data with raw
inside body
Request i want to send:
InputFormat=application/json&InputData={
"provider":"fb",
"profileId":"ashok",
"email":"ashok.kom",
"MobileNo":"91-868",
"FirstName":"Ashok",
"LastName":"Komara",
"gender":"M",
"loginId":"ashok",
"subscribeToOffers":"true"
}
My Api service
public interface APIService {
@Headers({"Content-Type: application/x-www-form-urlencoded",
"Accept: application/json",
"Consumer_Key: HHAKRMFG",
"Signature_Method: HMAC-SHA1",
"OAuth_Version: 1.0",
"Consumer_Secret: DPNQGUX1TKRYGWJOPH5DBLRB"})
@POST("LoginWithThirdPartyProvider")
@FormUrlEncoded
Call<ResponseList> savePost(@Field("provider") String provider,
@Field("profileId") String profileId,
@Field("email") String email,
@Field("MobileNo") String MobileNo,
@Field("FirstName") String FirstName,
@Field("LastName") String LastName,
@Field("gender") String gender,
@Field("loginId") String loginId,
@Field("subscribeToOffers") String subscribeToOffers);
}
Upvotes: 1
Views: 427
Reputation: 111
I have got got a way to do this or can say I have got answer of my question
This library help me to use retrofit
with oAuth 1.0
In the mid I got lot of minor errors which are easily resolve by searching on Internet
If you are using this library don't forget to add
<uses-library android:name="org.apache.http.legacy" android:required="false" />
in you <application
tag
Upvotes: 2