this is the API call
export const socialPostUpdateBio = (publicKey,sig,about)=>{
let data=
"pub="+ publicKey+
"&sig="+ sig.sig+
"&about="+about
console.log('====',data)
fetch('https://endpoint/postUpdateBio', {
method: 'POST',
headers: new Headers({
"Content-Type": "application/x-www-form-urlencoded", // <-- Specifying the Content-Type
Accept: "application/json"
}),
body:data
}).then((response) => response.json())
.then((responseJson) => {
console.log("New post updateBio",responseJson);
return responseJson.movies;
})
.catch((error) => {
console.error(error);
});
}
this is data about:Its coming as a string not as a object
{name:"Guruprakash Gupta",dob:"14/08/1997",location:"Bangalore",bio:"Gratitude",sex:"Male",profile_pic:"QmdDjpQ3G6vg7zkU2BBPMQJYsnnRtTEDEtL9xBXjvPh4i4-image-jpg"}
before api call we have a one more function where we are signing the data with private key,so signing of data is correct here so i haven't inculded that function.
this is what response im getting
Response {type: "default", status: 524, ok: false, statusText: undefined, headers: Headers, …}type: "default"status: 524ok: falsestatusText: undefinedheaders: Headers {map: {…}}url: "https://murmurjapi.wandx.co/accounts/postUpdateBio"_bodyInit: Blobdata: (...)size: (...)type: (...)_data: {size: 4831, offset: 0, blobId: "d07d8515-51de-48c1-950d-7d9a77c8c640"}size: 4831offset: 0blobId: "d07d8515-51de-48c1-950d-7d9a77c8c640"__proto__: Object__proto__: Objectdata: (...)size: (...)type: (...)constructor: ƒ Blob()slice: ƒ slice(start, end)close: ƒ close()get data: ƒ ()set data: ƒ (data)get size: ƒ ()get type: ƒ ()__proto__: Object_bodyBlob: Blob {_data: {…}}__proto__: ObjectbodyUsed: false_initBody: ƒ (body)blob: ƒ ()arrayBuffer: ƒ ()text: ƒ ()formData: ƒ ()json: ƒ ()clone: ƒ ()constructor: ƒ Response(bodyInit, options)__proto__: Object