Package akka.http.scaladsl.common
Class StrictForm
- java.lang.Object
-
- akka.http.scaladsl.common.StrictForm
-
public abstract class StrictForm extends java.lang.ObjectRead-only abstraction on top ofapplication/x-www-form-urlencodedand multipart form data, allowing joint unmarshalling access to either kind, **if** you supply both, aakka.http.scaladsl.unmarshalling.FromStringUnmarshalleras well as aakka.http.scaladsl.unmarshalling.FromEntityUnmarshallerfor the target typeT. Note: In order to allow for random access to the field values streamed multipart form data are strictified! Don't use this abstraction on potentially unbounded forms (e.g. large file uploads).If you only need to consume one type of form (
application/x-www-form-urlencoded*or* multipart) then simply unmarshal directly to the respective form abstraction (FormDataorMultipart.FormData) rather than going throughStrictForm.Simple usage example:
val strictFormFuture = Unmarshal(entity).to[StrictForm] val fooFieldUnmarshalled: Future[T] = strictFormFuture flatMap { form => Unmarshal(form field "foo").to[T] }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceStrictForm.Fieldstatic classStrictForm.Field$static classStrictForm.FileDataSimple model for strict file content in a multipart form data part.static classStrictForm.FileData$
-
Constructor Summary
Constructors Constructor Description StrictForm()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description scala.Option<StrictForm.Field>field(java.lang.String name)abstract scala.collection.immutable.Seq<scala.Tuple2<java.lang.String,StrictForm.Field>>fields()static scala.concurrent.duration.FiniteDurationtoStrictTimeout()static Unmarshaller<HttpEntity,StrictForm>unmarshaller(Unmarshaller<HttpEntity,FormData> formDataUM, Unmarshaller<HttpEntity,Multipart.FormData> multipartUM)
-
-
-
Method Detail
-
toStrictTimeout
public static scala.concurrent.duration.FiniteDuration toStrictTimeout()
-
unmarshaller
public static Unmarshaller<HttpEntity,StrictForm> unmarshaller(Unmarshaller<HttpEntity,FormData> formDataUM, Unmarshaller<HttpEntity,Multipart.FormData> multipartUM)
-
fields
public abstract scala.collection.immutable.Seq<scala.Tuple2<java.lang.String,StrictForm.Field>> fields()
-
field
public scala.Option<StrictForm.Field> field(java.lang.String name)
-
-