core


License

License

GroupId

GroupId

com.softwaremill.sttp.model
ArtifactId

ArtifactId

core_0.26
Last Version

Last Version

1.2.0-RC4
Release Date

Release Date

Type

Type

jar
Description

Description

core
core
Project URL

Project URL

http://softwaremill.com/open-source
Project Organization

Project Organization

com.softwaremill.sttp.model
Source Code Management

Source Code Management

https://github.com/softwaremill/sttp-model

Download core_0.26

How to add to project

<!-- https://jarcasting.com/artifacts/com.softwaremill.sttp.model/core_0.26/ -->
<dependency>
    <groupId>com.softwaremill.sttp.model</groupId>
    <artifactId>core_0.26</artifactId>
    <version>1.2.0-RC4</version>
</dependency>
// https://jarcasting.com/artifacts/com.softwaremill.sttp.model/core_0.26/
implementation 'com.softwaremill.sttp.model:core_0.26:1.2.0-RC4'
// https://jarcasting.com/artifacts/com.softwaremill.sttp.model/core_0.26/
implementation ("com.softwaremill.sttp.model:core_0.26:1.2.0-RC4")
'com.softwaremill.sttp.model:core_0.26:jar:1.2.0-RC4'
<dependency org="com.softwaremill.sttp.model" name="core_0.26" rev="1.2.0-RC4">
  <artifact name="core_0.26" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.softwaremill.sttp.model', module='core_0.26', version='1.2.0-RC4')
)
libraryDependencies += "com.softwaremill.sttp.model" % "core_0.26" % "1.2.0-RC4"
[com.softwaremill.sttp.model/core_0.26 "1.2.0-RC4"]

Dependencies

compile (1)

Group / Artifact Type Version
ch.epfl.lamp : dotty-library_0.26 jar 0.26.0-RC1

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_0.26 jar 3.2.2

Project Modules

There are no modules declared in this project.

sttp-model

Join the chat at https://gitter.im/softwaremill/sttp-model Build Status Maven Central

sttp is a family of Scala HTTP-related projects, and currently includes:

  • sttp client: The Scala HTTP client you always wanted!
  • sttp tapir: Typed API descRiptions
  • sttp model: this project. Simple Scala HTTP model. Used by sttp client & sttp tapir

Quickstart with sbt

Add the following dependency:

"com.softwaremill.sttp.model" %% "core" % "1.2.0-RC5"

sttp model is available for Scala 2.11, 2.12, 2.13, Scala.JS, Scala Native and Dotty 0.23.

Project content

Available model classes include:

  • Uri
  • Method
  • StatusCode
  • MediaType
  • Header
  • HeaderNames
  • Cookie
  • QueryParams
  • Part

Most classes contain both serialisation & parsing functionality, following these conventions:

  • .toString returns a representation of the model class in a format as in an HTTP request/response. For example, for an uri this will be http://..., for a header [name]: [value], etc.
  • [SthCompanionObject].parse(serialized: String): Either[String, Sth]: returns an error message or an instance of the model class
  • [SthCompanionObject].unsafeApply(values): creates an instance of the model class; validates the input values and in case of an error, throws an exception. An error could be e.g. that the input values contain characters outside of the allowed range
  • [SthCompanionObject].safeApply(...): Either[String, Sth]: same as above, but doesn't throw exceptions. Instead, returns an error message or the model class instance
  • [SthCompanionObject].apply(...): Sth: creates the model type, without validation, and without throwing exceptions

Documentation

Javadocs

The docs for sttp client contain documentation for the model classes: overview, uri interpolator.

Contributing

If you have a question, or hit a problem, feel free to ask on our gitter channel!

Or, if you encounter a bug, something is unclear in the code or documentation, don’t hesitate and open an issue on GitHub.

Building & testing the scala-native version

By default, sttp-native will not be included in the aggregate build of the root project. To include it, define the STTP_NATIVE environmental variable before running sbt, e.g.:

STTP_NATIVE=1 sbt

You might need to install some additional libraries, see the scala native documentation site.

Commercial Support

We offer commercial support for sttp and related technologies, as well as development services. Contact us to learn more about our offer!

Copyright

Copyright (C) 2017-2020 SoftwareMill https://softwaremill.com.

com.softwaremill.sttp.model

SoftwareMill

We love Scala, Akka, Cassandra and Kafka. We help teams get up to speed with functional programming, introduce event sourcing or define streaming data pipelines

Versions

Version
1.2.0-RC4
1.2.0-RC3
1.2.0-RC2
1.2.0-RC1
1.1.4