Giter VIP home page Giter VIP logo

Comments (5)

studioidan avatar studioidan commented on June 10, 2024

thank you.
i will check this ASAP!

how did find out there is no body in the request?
can i see your full code?

about deletation, i dont know what do you meen,
the project is rigt here
https://github.com/studioidan/HttpAgent

Sent with MailTrack
https://mailtrack.io/install?source=signature&lang=en&[email protected]&idSignature=22

2016-08-12 16:24 GMT+03:00 Maxime Charruel [email protected]:

Hi,

Thanks for your contribution.

Firstly, we don't have any access to your code or you have deleted it ? I
can't see any source code when I fork your project.

Secondly, I think there is a bug in your project (that's why I wanted to
fork it). In case of POST Method, if you had values in "body"
(.withBody("{name:popapp ,age:27}")), this is not working ! The request
doesn't have the body params.

TY


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3, or mute the thread
https://github.com/notifications/unsubscribe-auth/AEugVvepvejaVrwKQsCmlkd3HA0Fw0Ehks5qfHP-gaJpZM4JjFF3
.

פיתוח אפליקציות אנדרואיד - 0524667179

from httpagent.

Aximem avatar Aximem commented on June 10, 2024

You deleted all your source code in previous commit ...
83a0987

HttpAgent.post(baseAPIUrl + "xxx.json").headers("Authorization", tokenApp, "Content-Type","application/json", "Accept", "application/json").withBody("{email:" + email + ",password:" + password + ",salt:" + salt + "}").goJson(new JsonCallback() {@Override protected void onDone(boolean success, JSONObject jsonObject) {}});

from httpagent.

Aximem avatar Aximem commented on June 10, 2024

Back from vacation, in fact this is my bad, I didn't check the API I was requesting, it required JSON Post parameters, so I get your code and updated a little to manage this case :

public HttpAgent withBody(String... bodies) { if (bodies.length % 2 != 0) { mErrorMessage += "\nbodies must be even number"; Log.e(TAG, "bodies must be even number"); return this; } for (int i = 0; i < bodies.length; i += 2) { mBodies.put(bodies[i], bodies[i + 1]); } this.mHasBody = !U.isEmpty(bodies); return this; }
if (mHasBody) { JSONObject jsonParam = new JSONObject(); for (Map.Entry<String, String> entry : mBodies.entrySet()) { jsonParam.put(entry.getKey(), entry.getValue()); } DataOutputStream printout; printout = new DataOutputStream(mConnection.getOutputStream ()); String str = jsonParam.toString(); byte[] data=str.getBytes("UTF-8"); printout.write(data); printout.flush (); printout.close (); }

HttpAgent.post(baseAPIUrl + "clients.json") .headers("Authorization", tokenApp, "Content-Type", "application/json", "Accept", "application/json") .withBody("email", email, "password", password, "salt", salt)

Maybe you can upgrade your repo to manage this JSON case. Anyway Thanks for the feedback.
You should upgrade your repo anyway, there is not the source in last commit !

from httpagent.

studioidan avatar studioidan commented on June 10, 2024

tnx! i'll add this functionallity! is your api server is microsoft web api?

Sent with MailTrack
https://mailtrack.io/install?source=signature&lang=en&[email protected]&idSignature=22

2016-08-22 13:03 GMT+03:00 Maxime Charruel [email protected]:

Back from vacation, in fact this is my bad, I didn't check the API I was
requesting, it required JSON Post parameters, so I get your code and
updated a little to manage this case :

`public HttpAgent withBody(String... bodies) {
if (bodies.length % 2 != 0) {
mErrorMessage += "\nbodies must be even number";
Log.e(TAG, "bodies must be even number");
return this;
}
for (int i = 0; i < bodies.length; i += 2) {
mBodies.put(bodies[i], bodies[i + 1]);
}

this.mHasBody = !U.isEmpty(bodies);
return this;

}`

`if (mHasBody) {
JSONObject jsonParam = new JSONObject();

        for (Map.Entry<String, String> entry : mBodies.entrySet()) {
            jsonParam.put(entry.getKey(), entry.getValue());
        }

        DataOutputStream printout;
        printout = new DataOutputStream(mConnection.getOutputStream ());

        String str = jsonParam.toString();
        byte[] data=str.getBytes("UTF-8");
        printout.write(data);

        printout.flush ();
        printout.close ();
    }`

HttpAgent.post(baseAPIUrl + "clients.json")
.headers("Authorization", tokenApp, "Content-Type", "application/json",
"Accept", "application/json")
.withBody("email", email, "password", password, "salt", salt)

Maybe you can upgrade your repo to manage this JSON case. Anyway Thanks
for the feedback.
You should upgrade your repo anyway, there is not the source in last
commit !


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEugVq8rgEI7WVnq629FrGXNEEQl4a9aks5qiXQMgaJpZM4JjFF3
.

פיתוח אפליקציות אנדרואיד - 0524667179

from httpagent.

Aximem avatar Aximem commented on June 10, 2024

No, this is just a Symfony project with FOSRestBundle, we created an API with some methods. We could have use html params but we used JSON (dunno why ;))

from httpagent.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.