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

The HTTP GET invocation does not bind string data into anydata #6414

Closed
nipunayf opened this issue Apr 25, 2024 · 0 comments · Fixed by ballerina-platform/module-ballerina-http#1968
Assignees
Labels
module/http Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/PCM Protocol connector packages related issues Type/Bug

Comments

@nipunayf
Copy link

Description:
$title with the following error message.

error PayloadBindingClientError ("incompatible typedesc anydata found for 'text/plain' mime type")

Steps to reproduce:
Run the following service locally.

import ballerina/http;

listener http:Listener helloWorldEP = new (9090);

service /helloWorld on helloWorldEP {

    resource function get [string name]() returns string {
        return "Hello, World! " + name;
    }
}

Execute the following code.

import ballerina/http;
import ballerina/io;

public function main() returns error? {
    http:Client cl = check new ("http://localhost:9090/helloWorld/hi");
    anydata|http:ClientError get = cl->get("/");
    io:println(get);
}

Affected Versions:
Ballerina 2201.8.6 (Swan Lake Update 8)
http 2.11.0

OS, DB, other environment details and versions:
OS: macOS 14.4.1 23E224
JDK: openjdk 17.0.8 2023-07-18

@nipunayf nipunayf changed the title The HTTP GET invocation does not bind string data into anydata The HTTP GET invocation does not bind string data into anydata Apr 25, 2024
@TharmiganK TharmiganK added the Team/PCM Protocol connector packages related issues label Apr 25, 2024
@TharmiganK TharmiganK self-assigned this Apr 25, 2024
@TharmiganK TharmiganK added the Reason/EngineeringMistake The issue occurred due to a mistake made in the past. label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/http Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/PCM Protocol connector packages related issues Type/Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants