Base64 Encoder/Decoder API - Ruby Gem
Base64 Encoder/Decoder is a simple tool for encoding and decoding Base64 strings. It supports both encoding text to Base64 and decoding Base64 back to text.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_base64'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_base64
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_base64'
# Initialize the client
client = APIVerve::Base64::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({
text: "Hello World",
action: "encode"
})
# Print the response
puts response
Error Handling
begin
response = client.execute({ text: "Hello World", action: "encode" })
puts response["data"]
rescue APIVerve::Base64::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Base64::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Base64::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"action": "encode",
"original": "Hello World",
"encoded": "SGVsbG8gV29ybGQ=",
"length": 16
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/base64?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.