Skip to main content
Solved

httpcaller json payload too large, how to send one at a time from json file?

  • January 30, 2020
  • 8 replies
  • 106 views

Forum|alt.badge.img

I have a workspace that creates an ESRIJSON file of features. The problem is I have 90 to upload but any more than 2 features causes a http 414 uri too long return from the destination server with a POST request.

Any ideas on how to send 1 feature at a time? I tried WorkspaceRunner which processes one at a time but I need to write the json file from the incoming feature each time and I can't figure that out as yet.

 

 

Best answer by david_r

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • January 30, 2020

If you use a FeatureWriter and a FeatureReader you can easily write a json for each feature and read them back in for further processing. If you add a TempPathnameCreator you don't have to clean up files.

WriteRead(2019_1_2).fmwt


david_r
Celebrity
  • 8392 replies
  • January 30, 2020

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • January 30, 2020

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

I second this. You should put the json in the body, not in the URI.


Forum|alt.badge.img
  • Author
  • 29 replies
  • January 30, 2020

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

Configuration


Forum|alt.badge.img
  • Author
  • 29 replies
  • January 31, 2020

Based on the error message it sounds like the JSON is sent as part of the URL rather than in the message body.

Can you please post a screenshot of how the HTTPCaller has been configured?

Ok, so this works as captured in Fiddler but I don't know how to get that in the upload body for httpcaller


david_r
Celebrity
  • 8392 replies
  • Best Answer
  • January 31, 2020

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".


Forum|alt.badge.img
  • Author
  • 29 replies
  • February 2, 2020

You were very close, you just need to remove the features from the query string (=URI) and put the contents of the featureSet attribute in the "Upload body":

 

You'll probably also want to set the content type to "application/json".

I tried that but leaving the features in the params but moving the featureSet into Upload Body with application/json results in {"error":{"code":500,"message":"Unable to complete operation.","details":["Parser error: Some parameters could not be recognized."]}}

I suspect that the features param name as well as payload needs to be included in the upload body but can't seem to find the correct json example structure for this.


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • February 3, 2020

I tried that but leaving the features in the params but moving the featureSet into Upload Body with application/json results in {"error":{"code":500,"message":"Unable to complete operation.","details":["Parser error: Some parameters could not be recognized."]}}

I suspect that the features param name as well as payload needs to be included in the upload body but can't seem to find the correct json example structure for this.

For me it works with content-type set to application/x-www-form-urlencoded.

0684Q00000ArNBJQA3.png

I create "body" with an AttributeCreator using:

f=pjson&features=@Value(Features)&token=@Value(Token)

I create "Features" by Writing to Esri-JSON, reading back in as JSON (JavaScript Object Notation), Expose RecordSet, Extract json["features"].

0684Q00000ArNBEQA3.png

But I admit, compared to a lot the default writers, it can be tough to get writing to arcgis server via the api working.

addFeatures2019_1_2.fmwt