java.lang.IllegalArgumentException: Don't know how to encode {"file": "Users/Downloads/Testing_file_automation.zip" } as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application/zip", ContentType.TEXT))). .."

GitHub | Anishohri | 4 months ago
  1. 0

    GitHub comment 730#235647981

    GitHub | 4 months ago | Anishohri
    java.lang.IllegalArgumentException: Don't know how to encode {"file": "Users/Downloads/Testing_file_automation.zip" } as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application/zip", ContentType.TEXT))). .."
  2. 0

    Post request throws java.lang.IllegalArgumentException: Don't know how to encode as a byte stream with custom Content-Type

    Google Groups | 1 year ago | reachout6
    java.lang.IllegalArgumentException: Don't know how to encode as a byte stream
  3. 0

    question about SSL

    Google Groups | 5 years ago | FunTest
    java.lang.IllegalArgumentException: Don't know how to encode {"name": "test-REST", "start": 1336111200000,"end": 1336172400000} as a byte stream
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.lang.IllegalArgumentException: Don't know how to encode XXXX as a byte stream

    Google Groups | 2 years ago | Marrisa Li
    java.lang.IllegalArgumentException: Don't know how to encode ------WebKitFormBoundaryLU6DwOyPfQGHAbDG Content-Disposition: form-data; name="file"; filename="Circle.svg" Content-Type: image/svg+xml <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" version="1.1"><circle cx="0" cy="0" r="10" stroke="black" stroke-width="2" fill="red" /></svg> ------WebKitFormBoundaryLU6DwOyPfQGHAbDG-- as a byte stream
  6. 0

    Getting "java.lang.IllegalArgumentException: Don't know how to encode XXX as a byte stream."

    Stack Overflow | 6 months ago | Prasaad C
    java.lang.IllegalArgumentException: Don't know how to encode {"queryString": "Pearson AND unscrubbed:false"} as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application json", ContentType.TEXT))). .."

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Don't know how to encode {"file": "Users/Downloads/Testing_file_automation.zip" } as a byte stream. Please use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type. For example: "given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs("application/zip", ContentType.TEXT))). .."

      at com.jayway.restassured.internal.http.EncoderRegistry.encodeStream()
    2. REST Assured
      EncoderRegistry.encodeStream
      1. com.jayway.restassured.internal.http.EncoderRegistry.encodeStream(EncoderRegistry.java:129)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    4. Groovy
      Closure.call
      1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      3. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1210)
      4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1077)
      5. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
      6. groovy.lang.Closure.call(Closure.java:426)
      6 frames
    5. REST Assured
      RequestSpecificationImpl.sendRequest
      1. com.jayway.restassured.internal.http.HTTPBuilder$RequestConfigDelegate.setBody(HTTPBuilder.java:1088)
      2. com.jayway.restassured.internal.http.HTTPBuilder$RequestConfigDelegate.setPropertiesFromMap(HTTPBuilder.java:1002)
      3. com.jayway.restassured.internal.http.HTTPBuilder.post(HTTPBuilder.java:336)
      4. com.jayway.restassured.internal.http.HTTPBuilder$post$2.call(Unknown Source)
      5. com.jayway.restassured.internal.RequestSpecificationImpl.sendRequest(RequestSpecificationImpl.groovy:1137)
      5 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    7. Groovy
      MetaClassImpl.invokeMethod
      1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      3. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1210)
      4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
      5. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
      5 frames
    8. REST Assured
      RequestSpecificationImpl.invokeMethod
      1. com.jayway.restassured.internal.RequestSpecificationImpl.invokeMethod(RequestSpecificationImpl.groovy)
      1 frame
    9. Groovy
      AbstractCallSite.call
      1. org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
      2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:149)
      2 frames
    10. REST Assured
      Filter$filter$0.call
      1. com.jayway.restassured.internal.filter.SendRequestFilter.filter(SendRequestFilter.groovy:30)
      2. com.jayway.restassured.filter.Filter$filter$0.call(Unknown Source)
      2 frames
    11. Groovy
      CallSiteArray.defaultCall
      1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      1 frame
    12. REST Assured
      FilterContextImpl.next
      1. com.jayway.restassured.filter.Filter$filter.call(Unknown Source)
      2. com.jayway.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:73)
      2 frames
    13. com.jayway.restassured
      TimingFilter.filter
      1. com.jayway.restassured.filter.time.TimingFilter.filter(TimingFilter.java:56)
      1 frame
    14. REST Assured
      Filter$filter.call
      1. com.jayway.restassured.filter.Filter$filter.call(Unknown Source)
      1 frame
    15. Groovy
      CallSiteArray.defaultCall
      1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      1 frame
    16. REST Assured
      Filter$filter.call
      1. com.jayway.restassured.filter.Filter$filter.call(Unknown Source)
      2. com.jayway.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:73)
      3. com.jayway.restassured.filter.log.RequestLoggingFilter.filter(RequestLoggingFilter.java:101)
      4. com.jayway.restassured.filter.Filter$filter.call(Unknown Source)
      4 frames
    17. Groovy
      CallSiteArray.defaultCall
      1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      1 frame
    18. REST Assured
      RequestSpecificationImpl.applyPathParamsAndSendRequest
      1. com.jayway.restassured.filter.Filter$filter$0.call(Unknown Source)
      2. com.jayway.restassured.internal.filter.FilterContextImpl.next(FilterContextImpl.groovy:73)
      3. com.jayway.restassured.filter.FilterContext$next.call(Unknown Source)
      4. com.jayway.restassured.internal.RequestSpecificationImpl.applyPathParamsAndSendRequest(RequestSpecificationImpl.groovy:1574)
      4 frames
    19. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    20. Groovy
      MetaClassImpl.invokeMethod
      1. org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
      2. groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      3. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1210)
      4. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
      5. groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:810)
      5 frames
    21. REST Assured
      RequestSpecificationImpl.invokeMethod
      1. com.jayway.restassured.internal.RequestSpecificationImpl.invokeMethod(RequestSpecificationImpl.groovy)
      1 frame
    22. Groovy
      AbstractCallSite.callCurrent
      1. org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.call(PogoInterceptableSite.java:48)
      2. org.codehaus.groovy.runtime.callsite.PogoInterceptableSite.callCurrent(PogoInterceptableSite.java:58)
      3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
      3 frames
    23. REST Assured
      RequestSpecificationImpl.post
      1. com.jayway.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy:163)
      2. com.jayway.restassured.internal.RequestSpecificationImpl.post(RequestSpecificationImpl.groovy)
      2 frames
    24. com.newdemo.test
      UIBug.test
      1. com.newdemo.test.paam.UIBug.test(UIBug.java:95)
      1 frame
    25. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    26. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      13 frames
    27. JUnit4 Runner
      JUnit4TestReference.run
      1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      1 frame
    28. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      5 frames