I'm using the Plugin JSON API and i can't post nothing on "custom_fields".
On Postman (what i'm using to test) no matter what i put on value (i have tryied form-data and raw) but i can't post anything.
It stay on "custom_fields": {}
Related
I am trying to consume a publicly exposed URL and I need to pass auth headers to it. The format of the HTTP header is :
auth:{"Username": "p09jh789-f098-h6fv-b386-008cd88bd4fe","Password": "xxxxxxxx","authKey": "62b6380d-9e06-6age-cf09-134614b77d5e"}
I tried to set auth header for the REST API and I am not able to pass this JSON string since text headers throw up datatype issue. This happens even if I try to escape the JSON string. Please help me with doing it.
Send each value as a different header item. And validate each item in the OnBeforeRequest.
I using postman to test my api, and I need to send a PUT request that has a json object and some files. Im sending raw data to test this but I cant seem to figure out how to add a file in there.
PUT request
raw data example:
{
"email": "someone#something.com",
"info": "new account",
"file1" : (some file should be here),
"file2": (some file should be here)
}
You are not supposed to send files AND data in a PUT request, either the body of the request IS a file content, either you use POST to have multiple files of a file with other data.
I honestly can't explain more as I am stucked with the same kind of problem :-)
I am trying to crawl a ajax site using Scrapy, the url is http://www.target.com/p/bounty-select-a-size-white-paper-towels-12-mega-rolls/-/A-14920157#prodSlot=medium_1_2&term=bounty
My goal is to get the store id. I did that by checking all the XHR request in chrome developer tool and find the one with name ("v1?request_type=availability&key=.....") to be the one I want.
My questions are:
In developer tool, there is "Query string parameter" which seems to be the part after ? of the request url. There is also Request Payload section, which is a json.
So which one should I use to send to the server? If i need request payload, how can I send a json file?
when i send the whole url to get json:
https://api.target.com/available_to_promise_aggregator/v1?request_type=availability&key=q0jGNkIyuqUTYIlzZKoCfK6ugaNGSP8h
I get "Request method 'GET' not supported", so should I use POST instead or there is something wrong I did?
You must send the query string as part of the URL after a ?, as you guessed.
To include a JSON payload in a request, and send the request as a POST request, use the method and body parameters of the Request class.
I'm using Prestashop 1.6.1.1 web service and I need to send POST request with json content. Is there any way to achieve this? When I performed GET request and I added output_format=JSON parameter, I got json as a result. Is there any analogical parameter for input?
In follow-up to this question , my GET request is returning a 'application/json' content type.
I want this JSON content as a String, so that i can use the Jackson Library to validate if this is a properly constructed JSON or not. Is there any other way i can read this content apart from request.getParameter() ?
Note: For a POST request, i used request.getReader() to get the JSON content. But this doesn't work for a GET request.