I am trying to retrieve all of a user's ownedObjects. If the user has more than 999 ownedObjects, then the results contain a nextLink.
The documentation here states that skiptoken should not be extracted to make a different request.
However, I would like to extract it to make my next request. If the other parts of the original request URL match the corresponding parts of the nextLink request URL, would this be safe?
According to your description, I assume you want to make an different request to get more result of the user's owenedObjects.
Based on my test, we can use the nextLink property to make a different request.
As the description of the official document, Do not try to extract the $skiptoken or $skip value and use it in a different request.
Related
We have a portal whose POST request parameters are:
access_token, session_id,state
But I don't see any response containing values for the above mentioned parameters at all. Is there any way I can capture it?
If you don't see the values in the response body, the following options remain:
The values are in the URL, i.e. you're redirected at least once and the redirect target contains the values you're looking for in its URL
The values are in the response headers
both locations can be expected using View Results Tree listener and both locations can be queried using i.e. Regular Expression Extractor or Boundary Extractor
The values might come as the result of an AJAX request, JMeter is not a browser and it doesn't execute JavaScript so you will need to manually simulate these calls using individual HTTP Request samplers
The values might be calculated by JavaScript on browser side, if this is the case you will need to replicate the logic using JSR223 PreProcessor and Groovy language
I am attempting to use the Paginated Products API to make a GET request using the optional specialOffer parameter. I have made many requests with multiple variations of the parameters available and have received an empty JSON object for each request whenever I use the specialOffer parameter. However, when I use the other optional parameters available without the specialOffer parameter, such as category, brand, format, and count, I receive the expected response.
Example requests that returns empty JSON object:
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&specialOffer=specialBuy
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&category=3944_1060825_1939756&specialOffer=specialBuy&count=10
Example request that returns expected results:
http://api.walmartlabs.com/v1/paginated/items?apiKey=APIKEY&category=3944_1060825_1939756&count=10
In addition to this, I have ensured that there are items available which are in the specialBuy (as well as rollback and clearance) categories, by checking the Special Feeds like so:
http://api.walmartlabs.com/v1/feeds/specialbuy?apikey=APIKEY&categoryId=3944_1060825_1939756
Documentation for the Paginated Products API:
https://developer.walmartlabs.com/docs/read/Paginated_Products_API
Can anyone shed some light on this issue?
As we all know, file uploading is most often accomplished using POST method. So, why can't the GET method be used for file uploads instead? Is there a specific prohibition against HTTP GET uploads?
GET requests may contain an entity body
RFC 2616 does not prevent an entity body as part of a GET request. This is often misunderstood because PHP muddies the waters with its poorly-named $_GET superglobal. $_GET technically has nothing to do with the HTTP GET request method -- it's nothing more than a key-value list of url-encoded parameters from the request URI query string. You can access the $_GET array even if the request was made via POST/PUT/etc. Weird, right? Not a very good abstraction, is it?
Why a GET entity body is a bad idea
So what does the spec say about the GET method ... well:
In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval. These methods ought to be considered "safe."
So the important thing with GET is to make sure any GET request is safe. Still, the prohibition is
only "SHOULD NOT" ... technically HTTP still allows a GET requests to result in an action that isn't
strictly based around "retrieval."
Of course, from a semantic standpoint using a method named GET to perform an action other than
"getting" a resource doesn't make very much sense either.
When a GET entity body is flat-out wrong
Regarding idempotence, the spec says:
Methods can also have the property of "idempotence" in that (aside from error or expiration issues)
the side-effects of N > 0 identical requests is the same as for a single request. The methods GET,
HEAD, PUT and DELETE share this property.
This means that a GET method must not have differing side-effects for multiple requests for the
same resource. So, regardless of the entity body present as part of a GET request, the side-effects
must always be the same. In layman's terms this means that if you send a GET with an entity body
100 times the server cannot create 100 new resources. Whether sent once or 100 times the request must
have the same result. This severely limits the usefulness of the GET method for sending entity bodies.
When in doubt, always fall back to the safety/idempotence tests when evaluating the efficacy
of a method and its resulting side-effects.
In case of GET Method
Appends form-data into the URL in name/value pairs and length of URL is limited(3000 characters).
File content can't be put inside a URL parameter using a form.So use POST
In Get method, the value of action, appends a `?' to it, then appends the form data set, encoded using the "application/x-www-form-urlencoded" content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes.
So, that file upload is not possible in GET Method
I am creating an email client with API functionalities. One of the functionalities is to provide an API call to download a given attachment.
To obtain an attachment, given the filename and unique email ID (using the GMail X-MSG-ID unique identifier), I'm downloading the whole email, using the FETCH command with the RFC822 command. This is naturally very heavy.
What I want to do is download only the BODY part that is that attachment, such as BODY[1], BODY[2], etc. I know that obtaining the BODYSTRUCTURE gives me a list of parts in the format ("PART","ETC")("PART","ETC"). What I want to know is how these parts map to the BODY[0], BODY[1], etc.
Is the order that parts appear in the BODYSTRUCTURE response a direct mapping to the BODY indices? So if calling BODYSTRUCTURE I obtain ("123","ETC")("456","ETC")("789","ETC"), can I assume that BODY[0] is the "123" and that BODY[1] is the "456"? Or is there another way to map the elements in parenthesis in a BODYSTRUCTURE response to the BODY[0], BODY[1], etc?
Thank you
I have solved this through trial and error.
It would appear the BODY indeces are as they come in the BODYSTRUCTURE response. So, using the above example, if in the BODYSTRUCTURE response you obtain ("123","ETC")("456","ETC"), then when you call BODY[1] you will obtain the "123" part, when you call BODY[2] you will obtain "456", and so on.
I am using "/reader/api/0/stream/items/ids" API to get the item ids for sources that I want.
I have quite a number of sources, so I repeated "s=" parameter to include in the api url.
However, google has given me an error of "URL is too long".
So the question is that How can I solve it so that I just use one time api call to get item ids for that many sources?
Thanks
It seems that /reader/api/0/stream/items/ids path supports a POST method. This means the amount of data you could pass by using POST verb is much more than by using a query string and a GET method.
So use https://www.google.com/reader/api/0/stream/items/ids URL for the post, and pass your query string as a post data. Don't forget to include an action token(T) which is required for POST requests.