Editing
Poison
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Poison == [[File:PoisonLogo.png|thumb|Poison logo]] '''Poison''' is a fast, flexible, and feature-rich Elixir library for dealing with JSON. It enables developers to encode and decode JSON data effortlessly, making it an essential tool for working with web APIs, data exchange, and various other scenarios where JSON is involved. === Features === * Fully supports the JSON spec defined in [[RFC 8259]]. * Provides a simple and intuitive API for encoding and decoding JSON. * Can handle complex data structures, including nested maps, lists, and tuples. * Efficiently handles large data sets and supports streaming for improved performance. * Offers advanced options for customization, such as custom encoders, decoders, and transformations. * Supports encoding and decoding of user-defined types, extending the library's capabilities. === Installation === To use Poison in your Elixir project, simply add it as a dependency in your `mix.exs` file: ```elixir defp deps do [ {:poison, "~> 4.0"} ] end ``` Then, run `mix deps.get` to fetch the dependency. === Usage === Once Poison is included in your project, you can easily start encoding and decoding JSON data. To encode an Elixir data structure into JSON: ```elixir json = Poison.encode(%{key: "value"}) ``` To decode JSON data into an Elixir structure: ```elixir data = Poison.decode!(json) ``` You can also specify options during encoding or decoding: ```elixir json = Poison.encode(%{key: "value"}, keys: :atoms) data = Poison.decode!(json, keys: :atoms) ``` For more detailed examples and information on how to use Poison effectively, check out the [[Poison/Examples|Poison Examples]] page. === Further Resources === * [[Poison/Guides|Poison Guides]] - A comprehensive guide to using Poison effectively. * [[Poison/Examples|Poison Examples]] - A collection of practical examples demonstrating Poison's capabilities. * [[Poison/Changelog|Poison Changelog]] - Release notes and version history of Poison. '''Note:''' Before using Poison in your project, it is recommended to refer to the [https://github.com/devinus/poison Poison GitHub repository] for the latest updates and documentation. {{ProgrammingLanguages}} [[Category:Elixir Libraries]] [[Category:JSON]] [[Category:Data Serialization]]
Summary:
Please note that all contributions to Elixir Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Elixir Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:ProgrammingLanguages
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information