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

Help me !! #42

Open
RodysRod opened this issue Dec 1, 2020 · 6 comments
Open

Help me !! #42

RodysRod opened this issue Dec 1, 2020 · 6 comments

Comments

@RodysRod
Copy link

RodysRod commented Dec 1, 2020

Hello I'm trying to use a json's post but the addData function doesn't understand json to compose the request, I tried the example that is available, but an error appears (the "addData" function expects parameters like "addData (String, String)" in my http server along with my api in the postman is working, I wanted to test with processing, could help me.
ErrorPostJson

@JonasGruenwald
Copy link

Well like it says, you're supplying a single string with some stuff inside but the function expects two strings like this, first being the key and second being the value:

post.addData("on","false");

@RodysRod
Copy link
Author

RodysRod commented Jan 6, 2021

Bem, como diz, você está fornecendo uma única string com algumas coisas dentro, mas a função espera duas strings como esta, a primeira sendo a chave e a segunda sendo o valor:

post.addData("on","false");

Well, nice to try to clarify, but it is a json like the one described in the header, it is not just a text, the point is that at the root of the processing it does not understand the {} keys if they are used without "" as in a structure is understood as a void {}.

@JonasGruenwald
Copy link

Ah ok, I guess you are basing this on the overloaded addData function here in the source ?
https://github.com/runemadsen/HTTP-Requests-for-Processing/blob/master/src/http/requests/PostRequest.java#L71
since it's nowhere in the documentations or examples, I guess it is not in the current release...
but if you just copy it over from the source into your processing project it should work just fine

Screenshot 2021-01-06 at 23 09 22

@RodysRod
Copy link
Author

RodysRod commented Jan 7, 2021

Ah ok, I guess you are basing this on the overloaded addData function here in the source ?
https://github.com/runemadsen/HTTP-Requests-for-Processing/blob/master/src/http/requests/PostRequest.java#L71
since it's nowhere in the documentations or examples, I guess it is not in the current release...
but if you just copy it over from the source into your processing project it should work just fine

Screenshot 2021-01-06 at 23 09 22

Thanks for the help, but even changing it at the root I didn't get a positive result.
Capturar1

@JonasGruenwald
Copy link

Ah right, I didn't change it at the root or anything, don't even know where library files are stored in processing, I just meant not importing the library but copying that specific class (PostRequest) from the source into a different tab in your processing project just like that to make it work, it does work for me.
Just as a temporary workaround, obviously ideally they would release a new version with the overloaded function included.

Screenshot 2021-01-07 at 00 14 03

@RodysRod
Copy link
Author

RodysRod commented Jan 7, 2021

Ah right, I didn't change it at the root or anything, don't even know where library files are stored in processing, I just meant not importing the library but copying that specific class (PostRequest) from the source into a different tab in your processing project just like that to make it work, it does work for me.
Just as a temporary workaround, obviously ideally they would release a new version with the overloaded function included.

Screenshot 2021-01-07 at 00 14 03

Thank you very much, it worked the way you gave it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants