11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/txgh/transifex_api.rb', line 11
def create_from_credentials(username, password)
connection = Faraday.new(url: 'https://www.transifex.com') do |faraday|
faraday.request(:multipart)
faraday.request(:json)
faraday.request(:url_encoded)
faraday.response(:logger)
faraday.use(FaradayMiddleware::FollowRedirects)
faraday.adapter(Faraday.default_adapter)
end
connection.basic_auth(username, password)
connection..update(Accept: 'application/json')
create_from_connection(connection)
end
|