0

I have tried like this from the response:

{success: true, result: {picture: "picture-1529913236852.jpg"}}

I need to get picture only from jsonstringify, Here is my code:

this.http.post('myurl', uploadData)
.subscribe(res =>{
    console.log("meee"+JSON.stringify(res));
    this.imageResp = JSON.stringify(res.picture) // here i cant take my picture values
});

please Help me.

1
  • Can you share what is the typeof response using typeof(res)? Commented Jun 26, 2018 at 9:36

1 Answer 1

4

You do not need JSON.stringify since its already an object,

just use

this.imageResp = res.result.picture;
Sign up to request clarification or add additional context in comments.

3 Comments

you need res.result.picture
i dont know the format to get picture seperate as you said
@SelvaMeena before fetching from res.result.picture you could check if the returned json actually has a picture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.