Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method HEAD must not have a request body #891

Closed
nacyolsa opened this issue Aug 3, 2023 · 3 comments
Closed

Method HEAD must not have a request body #891

nacyolsa opened this issue Aug 3, 2023 · 3 comments
Assignees
Labels
good first issue Good for newcomers kind/bug Something isn't working P1
Milestone

Comments

@nacyolsa
Copy link

nacyolsa commented Aug 3, 2023

Expected Behavior

HEAD method should work.

Actual Behavior

I'm trying to invoke HEAD method but I'm receiving exception method HEAD must not have a request body..

java.lang.IllegalArgumentException: method HEAD must not have a request body.
	at okhttp3.Request$Builder.method(Request.kt:258)
	at io.dapr.client.DaprHttp.doInvokeApi(DaprHttp.java:301)
	at io.dapr.client.DaprHttp.lambda$invokeApi$0(DaprHttp.java:234)
	at reactor.core.publisher.MonoCallable.call(MonoCallable.java:72)
	at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:127)
	at reactor.core.publisher.MonoFlatMap.subscribeOrReturn(MonoFlatMap.java:53)
	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
	at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55)
	at reactor.core.publisher.Mono.subscribe(Mono.java:4444)
	at kotlinx.coroutines.reactor.MonoKt.awaitSingleOrNull(Mono.kt:47)

Steps to Reproduce the Problem

daprClient.invokeMethod<Unit>(
            InvokeMethodRequest(
                "test",
                "test-head"
            ).apply {
                httpExtension = HttpExtension(
                    DaprHttp.HttpMethods.HEAD,
                )
                body = null
            },
            null
        )

Am I doing something wrong or it's some bug?

I use dapr-sdk 1.9.0 but I also tried with 1.7.1 version.

@nacyolsa nacyolsa added the kind/bug Something isn't working label Aug 3, 2023
@artursouza artursouza added P1 good first issue Good for newcomers labels Aug 25, 2023
@artursouza artursouza added this to the v1.10 milestone Aug 25, 2023
@AishwaryaBalyaya01
Copy link

/assign

@AishwaryaBalyaya01
Copy link

AishwaryaBalyaya01 commented Sep 22, 2023

We have to remove body=null, this way

daprClient.invokeMethod(
InvokeMethodRequest(
"test",
"test-head"
).apply {
httpExtension = HttpExtension(
DaprHttp.HttpMethods.HEAD
)
},
null
)

As I am not able to resolve build issues, and I know how to solve it I have mentioned the solution here!

@AishwaryaBalyaya01 AishwaryaBalyaya01 removed their assignment Sep 22, 2023
@artursouza artursouza modified the milestones: v1.10, v1.11 Oct 3, 2023
@MregXN
Copy link
Member

MregXN commented Nov 13, 2023

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/bug Something isn't working P1
Projects
No open projects
Status: In Progress
Development

No branches or pull requests

4 participants